/*
 *
 *    Copyright (c) 2021 Project CHIP Authors
 *
 *    Licensed under the Apache License, Version 2.0 (the "License");
 *    you may not use this file except in compliance with the License.
 *    You may obtain a copy of the License at
 *
 *        http://www.apache.org/licenses/LICENSE-2.0
 *
 *    Unless required by applicable law or agreed to in writing, software
 *    distributed under the License is distributed on an "AS IS" BASIS,
 *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *    See the License for the specific language governing permissions and
 *    limitations under the License.
 */

// THIS FILE IS GENERATED BY ZAP

#include <core/CHIPCore.h>

#include <app/CommandSender.h>
#include <app/InteractionModelEngine.h>
#include <lib/support/Span.h>

#include <controller/CHIPDevice.h>

#include "gen/CHIPClientCallbacks.h"
#include "gen/CHIPClusters.h"

using namespace chip;
using namespace chip::app;

namespace {

// Define pointers for external ZCL response delegates.

using SuccessResponseDelegate = void (*)();
using FailureResponseDelegate = void (*)(uint8_t);
SuccessResponseDelegate gSuccessResponseDelegate;
FailureResponseDelegate gFailureResponseDelegate;

// Define callbacks for ZCL commands and attribute requests.

void OnDefaultSuccessResponse(void * /* context */)
{
    if (gSuccessResponseDelegate != nullptr)
        gSuccessResponseDelegate();
}

void OnDefaultFailureResponse(void * /* context */, uint8_t status)
{
    if (gFailureResponseDelegate != nullptr)
        gFailureResponseDelegate(status);
}

template <class AttributeType>
void OnAttributeResponse(void * /* context */, AttributeType value)
{
    std::string strValue = std::to_string(value);
    ChipLogProgress(Zcl, "  attributeValue: %s", strValue.c_str());
    if (gSuccessResponseDelegate != nullptr)
        gSuccessResponseDelegate();
}

template <>
void OnAttributeResponse<chip::ByteSpan>(void * /* context */, chip::ByteSpan value)
{
    std::string strValue = "";
    for (size_t i = 0; i < value.size(); i++)
    {
        strValue += ' ';
        strValue += std::to_string(value.data()[i]);
    }
    ChipLogProgress(Zcl, "  attributeValue: (span of length %zd) %s", value.size(), strValue.c_str());
    if (gSuccessResponseDelegate != nullptr)
        gSuccessResponseDelegate();
}

template <>
void OnAttributeResponse<bool>(void * /* context */, bool value)
{
    ChipLogProgress(Zcl, "  attributeValue: %s", value ? "true" : "false");
    if (gSuccessResponseDelegate != nullptr)
        gSuccessResponseDelegate();
}

static void OnApplicationLauncherApplicationLauncherListListAttributeResponse(void * context, uint16_t count, uint16_t * entries)
{
    ChipLogProgress(Zcl, "  attributeValue: List of length %" PRIu16, count);
    if (gSuccessResponseDelegate != nullptr)
        gSuccessResponseDelegate();
}
chip::Callback::Callback<ApplicationLauncherApplicationLauncherListListAttributeCallback>
    gApplicationLauncherApplicationLauncherListListAttributeCallback{
        OnApplicationLauncherApplicationLauncherListListAttributeResponse, nullptr
    };
static void OnAudioOutputAudioOutputListListAttributeResponse(void * context, uint16_t count, _AudioOutputInfo * entries)
{
    ChipLogProgress(Zcl, "  attributeValue: List of length %" PRIu16, count);
    if (gSuccessResponseDelegate != nullptr)
        gSuccessResponseDelegate();
}
chip::Callback::Callback<AudioOutputAudioOutputListListAttributeCallback> gAudioOutputAudioOutputListListAttributeCallback{
    OnAudioOutputAudioOutputListListAttributeResponse, nullptr
};
static void OnContentLauncherAcceptsHeaderListListAttributeResponse(void * context, uint16_t count, chip::ByteSpan * entries)
{
    ChipLogProgress(Zcl, "  attributeValue: List of length %" PRIu16, count);
    if (gSuccessResponseDelegate != nullptr)
        gSuccessResponseDelegate();
}
chip::Callback::Callback<ContentLauncherAcceptsHeaderListListAttributeCallback>
    gContentLauncherAcceptsHeaderListListAttributeCallback{ OnContentLauncherAcceptsHeaderListListAttributeResponse, nullptr };
static void OnContentLauncherSupportedStreamingTypesListAttributeResponse(void * context, uint16_t count, uint8_t * entries)
{
    ChipLogProgress(Zcl, "  attributeValue: List of length %" PRIu16, count);
    if (gSuccessResponseDelegate != nullptr)
        gSuccessResponseDelegate();
}
chip::Callback::Callback<ContentLauncherSupportedStreamingTypesListAttributeCallback>
    gContentLauncherSupportedStreamingTypesListAttributeCallback{ OnContentLauncherSupportedStreamingTypesListAttributeResponse,
                                                                  nullptr };
static void OnDescriptorDeviceListListAttributeResponse(void * context, uint16_t count, _DeviceType * entries)
{
    ChipLogProgress(Zcl, "  attributeValue: List of length %" PRIu16, count);
    if (gSuccessResponseDelegate != nullptr)
        gSuccessResponseDelegate();
}
chip::Callback::Callback<DescriptorDeviceListListAttributeCallback> gDescriptorDeviceListListAttributeCallback{
    OnDescriptorDeviceListListAttributeResponse, nullptr
};
static void OnDescriptorServerListListAttributeResponse(void * context, uint16_t count, chip::ClusterId * entries)
{
    ChipLogProgress(Zcl, "  attributeValue: List of length %" PRIu16, count);
    if (gSuccessResponseDelegate != nullptr)
        gSuccessResponseDelegate();
}
chip::Callback::Callback<DescriptorServerListListAttributeCallback> gDescriptorServerListListAttributeCallback{
    OnDescriptorServerListListAttributeResponse, nullptr
};
static void OnDescriptorClientListListAttributeResponse(void * context, uint16_t count, chip::ClusterId * entries)
{
    ChipLogProgress(Zcl, "  attributeValue: List of length %" PRIu16, count);
    if (gSuccessResponseDelegate != nullptr)
        gSuccessResponseDelegate();
}
chip::Callback::Callback<DescriptorClientListListAttributeCallback> gDescriptorClientListListAttributeCallback{
    OnDescriptorClientListListAttributeResponse, nullptr
};
static void OnDescriptorPartsListListAttributeResponse(void * context, uint16_t count, chip::EndpointId * entries)
{
    ChipLogProgress(Zcl, "  attributeValue: List of length %" PRIu16, count);
    if (gSuccessResponseDelegate != nullptr)
        gSuccessResponseDelegate();
}
chip::Callback::Callback<DescriptorPartsListListAttributeCallback> gDescriptorPartsListListAttributeCallback{
    OnDescriptorPartsListListAttributeResponse, nullptr
};
static void OnFixedLabelLabelListListAttributeResponse(void * context, uint16_t count, _LabelStruct * entries)
{
    ChipLogProgress(Zcl, "  attributeValue: List of length %" PRIu16, count);
    if (gSuccessResponseDelegate != nullptr)
        gSuccessResponseDelegate();
}
chip::Callback::Callback<FixedLabelLabelListListAttributeCallback> gFixedLabelLabelListListAttributeCallback{
    OnFixedLabelLabelListListAttributeResponse, nullptr
};
static void OnGeneralDiagnosticsNetworkInterfacesListAttributeResponse(void * context, uint16_t count,
                                                                       _NetworkInterfaceType * entries)
{
    ChipLogProgress(Zcl, "  attributeValue: List of length %" PRIu16, count);
    if (gSuccessResponseDelegate != nullptr)
        gSuccessResponseDelegate();
}
chip::Callback::Callback<GeneralDiagnosticsNetworkInterfacesListAttributeCallback>
    gGeneralDiagnosticsNetworkInterfacesListAttributeCallback{ OnGeneralDiagnosticsNetworkInterfacesListAttributeResponse,
                                                               nullptr };
static void OnGroupKeyManagementGroupsListAttributeResponse(void * context, uint16_t count, _GroupState * entries)
{
    ChipLogProgress(Zcl, "  attributeValue: List of length %" PRIu16, count);
    if (gSuccessResponseDelegate != nullptr)
        gSuccessResponseDelegate();
}
chip::Callback::Callback<GroupKeyManagementGroupsListAttributeCallback> gGroupKeyManagementGroupsListAttributeCallback{
    OnGroupKeyManagementGroupsListAttributeResponse, nullptr
};
static void OnGroupKeyManagementGroupKeysListAttributeResponse(void * context, uint16_t count, _GroupKey * entries)
{
    ChipLogProgress(Zcl, "  attributeValue: List of length %" PRIu16, count);
    if (gSuccessResponseDelegate != nullptr)
        gSuccessResponseDelegate();
}
chip::Callback::Callback<GroupKeyManagementGroupKeysListAttributeCallback> gGroupKeyManagementGroupKeysListAttributeCallback{
    OnGroupKeyManagementGroupKeysListAttributeResponse, nullptr
};
static void OnMediaInputMediaInputListListAttributeResponse(void * context, uint16_t count, _MediaInputInfo * entries)
{
    ChipLogProgress(Zcl, "  attributeValue: List of length %" PRIu16, count);
    if (gSuccessResponseDelegate != nullptr)
        gSuccessResponseDelegate();
}
chip::Callback::Callback<MediaInputMediaInputListListAttributeCallback> gMediaInputMediaInputListListAttributeCallback{
    OnMediaInputMediaInputListListAttributeResponse, nullptr
};
static void OnOperationalCredentialsFabricsListListAttributeResponse(void * context, uint16_t count, _FabricDescriptor * entries)
{
    ChipLogProgress(Zcl, "  attributeValue: List of length %" PRIu16, count);
    if (gSuccessResponseDelegate != nullptr)
        gSuccessResponseDelegate();
}
chip::Callback::Callback<OperationalCredentialsFabricsListListAttributeCallback>
    gOperationalCredentialsFabricsListListAttributeCallback{ OnOperationalCredentialsFabricsListListAttributeResponse, nullptr };
static void OnTvChannelTvChannelListListAttributeResponse(void * context, uint16_t count, _TvChannelInfo * entries)
{
    ChipLogProgress(Zcl, "  attributeValue: List of length %" PRIu16, count);
    if (gSuccessResponseDelegate != nullptr)
        gSuccessResponseDelegate();
}
chip::Callback::Callback<TvChannelTvChannelListListAttributeCallback> gTvChannelTvChannelListListAttributeCallback{
    OnTvChannelTvChannelListListAttributeResponse, nullptr
};
static void OnTargetNavigatorTargetNavigatorListListAttributeResponse(void * context, uint16_t count,
                                                                      _NavigateTargetTargetInfo * entries)
{
    ChipLogProgress(Zcl, "  attributeValue: List of length %" PRIu16, count);
    if (gSuccessResponseDelegate != nullptr)
        gSuccessResponseDelegate();
}
chip::Callback::Callback<TargetNavigatorTargetNavigatorListListAttributeCallback>
    gTargetNavigatorTargetNavigatorListListAttributeCallback{ OnTargetNavigatorTargetNavigatorListListAttributeResponse, nullptr };
static void OnTestClusterListInt8uListAttributeResponse(void * context, uint16_t count, uint8_t * entries)
{
    ChipLogProgress(Zcl, "  attributeValue: List of length %" PRIu16, count);
    if (gSuccessResponseDelegate != nullptr)
        gSuccessResponseDelegate();
}
chip::Callback::Callback<TestClusterListInt8uListAttributeCallback> gTestClusterListInt8uListAttributeCallback{
    OnTestClusterListInt8uListAttributeResponse, nullptr
};
static void OnTestClusterListOctetStringListAttributeResponse(void * context, uint16_t count, chip::ByteSpan * entries)
{
    ChipLogProgress(Zcl, "  attributeValue: List of length %" PRIu16, count);
    if (gSuccessResponseDelegate != nullptr)
        gSuccessResponseDelegate();
}
chip::Callback::Callback<TestClusterListOctetStringListAttributeCallback> gTestClusterListOctetStringListAttributeCallback{
    OnTestClusterListOctetStringListAttributeResponse, nullptr
};
static void OnTestClusterListStructOctetStringListAttributeResponse(void * context, uint16_t count, _TestListStructOctet * entries)
{
    ChipLogProgress(Zcl, "  attributeValue: List of length %" PRIu16, count);
    if (gSuccessResponseDelegate != nullptr)
        gSuccessResponseDelegate();
}
chip::Callback::Callback<TestClusterListStructOctetStringListAttributeCallback>
    gTestClusterListStructOctetStringListAttributeCallback{ OnTestClusterListStructOctetStringListAttributeResponse, nullptr };
static void OnThreadNetworkDiagnosticsNeighborTableListListAttributeResponse(void * context, uint16_t count,
                                                                             _NeighborTable * entries)
{
    ChipLogProgress(Zcl, "  attributeValue: List of length %" PRIu16, count);
    if (gSuccessResponseDelegate != nullptr)
        gSuccessResponseDelegate();
}
chip::Callback::Callback<ThreadNetworkDiagnosticsNeighborTableListListAttributeCallback>
    gThreadNetworkDiagnosticsNeighborTableListListAttributeCallback{
        OnThreadNetworkDiagnosticsNeighborTableListListAttributeResponse, nullptr
    };
static void OnThreadNetworkDiagnosticsRouteTableListListAttributeResponse(void * context, uint16_t count, _RouteTable * entries)
{
    ChipLogProgress(Zcl, "  attributeValue: List of length %" PRIu16, count);
    if (gSuccessResponseDelegate != nullptr)
        gSuccessResponseDelegate();
}
chip::Callback::Callback<ThreadNetworkDiagnosticsRouteTableListListAttributeCallback>
    gThreadNetworkDiagnosticsRouteTableListListAttributeCallback{ OnThreadNetworkDiagnosticsRouteTableListListAttributeResponse,
                                                                  nullptr };
static void OnThreadNetworkDiagnosticsSecurityPolicyListAttributeResponse(void * context, uint16_t count, _SecurityPolicy * entries)
{
    ChipLogProgress(Zcl, "  attributeValue: List of length %" PRIu16, count);
    if (gSuccessResponseDelegate != nullptr)
        gSuccessResponseDelegate();
}
chip::Callback::Callback<ThreadNetworkDiagnosticsSecurityPolicyListAttributeCallback>
    gThreadNetworkDiagnosticsSecurityPolicyListAttributeCallback{ OnThreadNetworkDiagnosticsSecurityPolicyListAttributeResponse,
                                                                  nullptr };
static void OnThreadNetworkDiagnosticsOperationalDatasetComponentsListAttributeResponse(void * context, uint16_t count,
                                                                                        _OperationalDatasetComponents * entries)
{
    ChipLogProgress(Zcl, "  attributeValue: List of length %" PRIu16, count);
    if (gSuccessResponseDelegate != nullptr)
        gSuccessResponseDelegate();
}
chip::Callback::Callback<ThreadNetworkDiagnosticsOperationalDatasetComponentsListAttributeCallback>
    gThreadNetworkDiagnosticsOperationalDatasetComponentsListAttributeCallback{
        OnThreadNetworkDiagnosticsOperationalDatasetComponentsListAttributeResponse, nullptr
    };
static void OnThreadNetworkDiagnosticsActiveNetworkFaultsListListAttributeResponse(void * context, uint16_t count,
                                                                                   uint8_t * entries)
{
    ChipLogProgress(Zcl, "  attributeValue: List of length %" PRIu16, count);
    if (gSuccessResponseDelegate != nullptr)
        gSuccessResponseDelegate();
}
chip::Callback::Callback<ThreadNetworkDiagnosticsActiveNetworkFaultsListListAttributeCallback>
    gThreadNetworkDiagnosticsActiveNetworkFaultsListListAttributeCallback{
        OnThreadNetworkDiagnosticsActiveNetworkFaultsListListAttributeResponse, nullptr
    };

chip::Callback::Callback<DefaultSuccessCallback> gDefaultSuccessCallback{ OnDefaultSuccessResponse, nullptr };
chip::Callback::Callback<DefaultFailureCallback> gDefaultFailureCallback{ OnDefaultFailureResponse, nullptr };
chip::Callback::Callback<BooleanAttributeCallback> gBooleanAttributeCallback{ OnAttributeResponse<bool>, nullptr };
chip::Callback::Callback<Int8uAttributeCallback> gInt8uAttributeCallback{ OnAttributeResponse<uint8_t>, nullptr };
chip::Callback::Callback<Int8sAttributeCallback> gInt8sAttributeCallback{ OnAttributeResponse<int8_t>, nullptr };
chip::Callback::Callback<Int16uAttributeCallback> gInt16uAttributeCallback{ OnAttributeResponse<uint16_t>, nullptr };
chip::Callback::Callback<Int16sAttributeCallback> gInt16sAttributeCallback{ OnAttributeResponse<int16_t>, nullptr };
chip::Callback::Callback<Int32uAttributeCallback> gInt32uAttributeCallback{ OnAttributeResponse<uint32_t>, nullptr };
chip::Callback::Callback<Int32sAttributeCallback> gInt32sAttributeCallback{ OnAttributeResponse<int32_t>, nullptr };
chip::Callback::Callback<Int64uAttributeCallback> gInt64uAttributeCallback{ OnAttributeResponse<uint64_t>, nullptr };
chip::Callback::Callback<Int64sAttributeCallback> gInt64sAttributeCallback{ OnAttributeResponse<int64_t>, nullptr };
chip::Callback::Callback<StringAttributeCallback> gStringAttributeCallback{ OnAttributeResponse<ByteSpan>, nullptr };

} // namespace

extern "C" {

void chip_ime_SetSuccessResponseDelegate(SuccessResponseDelegate delegate)
{
    gSuccessResponseDelegate = delegate;
}

void chip_ime_SetFailureResponseDelegate(FailureResponseDelegate delegate)
{
    gFailureResponseDelegate = delegate;
}

// Cluster AccountLogin

CHIP_ERROR chip_ime_AppendCommand_AccountLogin_GetSetupPIN(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                           chip::GroupId, const uint8_t * tempAccountIdentifier,
                                                           uint32_t tempAccountIdentifier_Len)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::AccountLoginCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.GetSetupPIN(nullptr, nullptr, chip::ByteSpan(tempAccountIdentifier, tempAccountIdentifier_Len));
}
CHIP_ERROR chip_ime_AppendCommand_AccountLogin_Login(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                     chip::GroupId, const uint8_t * tempAccountIdentifier,
                                                     uint32_t tempAccountIdentifier_Len, const uint8_t * setupPIN,
                                                     uint32_t setupPIN_Len)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::AccountLoginCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.Login(nullptr, nullptr, chip::ByteSpan(tempAccountIdentifier, tempAccountIdentifier_Len),
                         chip::ByteSpan(setupPIN, setupPIN_Len));
}

CHIP_ERROR chip_ime_ReadAttribute_AccountLogin_ClusterRevision(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                               chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::AccountLoginCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

// End of Cluster AccountLogin
// Cluster ApplicationBasic

CHIP_ERROR chip_ime_AppendCommand_ApplicationBasic_ChangeStatus(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                                chip::GroupId, uint8_t status)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ApplicationBasicCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ChangeStatus(nullptr, nullptr, status);
}

CHIP_ERROR chip_ime_ReadAttribute_ApplicationBasic_VendorName(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                              chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ApplicationBasicCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeVendorName(gStringAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_ApplicationBasic_VendorId(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                            chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ApplicationBasicCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeVendorId(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_ApplicationBasic_ApplicationName(chip::Controller::Device * device,
                                                                   chip::EndpointId ZCLendpointId, chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ApplicationBasicCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeApplicationName(gStringAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_ApplicationBasic_ProductId(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                             chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ApplicationBasicCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeProductId(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_ApplicationBasic_ApplicationId(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                                 chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ApplicationBasicCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeApplicationId(gStringAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_ApplicationBasic_CatalogVendorId(chip::Controller::Device * device,
                                                                   chip::EndpointId ZCLendpointId, chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ApplicationBasicCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeCatalogVendorId(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_ApplicationBasic_ApplicationStatus(chip::Controller::Device * device,
                                                                     chip::EndpointId ZCLendpointId, chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ApplicationBasicCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeApplicationStatus(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_ApplicationBasic_ClusterRevision(chip::Controller::Device * device,
                                                                   chip::EndpointId ZCLendpointId, chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ApplicationBasicCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

// End of Cluster ApplicationBasic
// Cluster ApplicationLauncher

CHIP_ERROR chip_ime_AppendCommand_ApplicationLauncher_LaunchApp(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                                chip::GroupId, const uint8_t * data, uint32_t data_Len,
                                                                uint16_t catalogVendorId, const uint8_t * applicationId,
                                                                uint32_t applicationId_Len)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ApplicationLauncherCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.LaunchApp(nullptr, nullptr, chip::ByteSpan(data, data_Len), catalogVendorId,
                             chip::ByteSpan(applicationId, applicationId_Len));
}

CHIP_ERROR chip_ime_ReadAttribute_ApplicationLauncher_ApplicationLauncherList(chip::Controller::Device * device,
                                                                              chip::EndpointId ZCLendpointId,
                                                                              chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ApplicationLauncherCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeApplicationLauncherList(gApplicationLauncherApplicationLauncherListListAttributeCallback.Cancel(),
                                                        gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_ApplicationLauncher_CatalogVendorId(chip::Controller::Device * device,
                                                                      chip::EndpointId ZCLendpointId,
                                                                      chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ApplicationLauncherCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeCatalogVendorId(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_ApplicationLauncher_ApplicationId(chip::Controller::Device * device,
                                                                    chip::EndpointId ZCLendpointId, chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ApplicationLauncherCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeApplicationId(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_ApplicationLauncher_ClusterRevision(chip::Controller::Device * device,
                                                                      chip::EndpointId ZCLendpointId,
                                                                      chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ApplicationLauncherCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

// End of Cluster ApplicationLauncher
// Cluster AudioOutput

CHIP_ERROR chip_ime_AppendCommand_AudioOutput_RenameOutput(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                           chip::GroupId, uint8_t index, const uint8_t * name, uint32_t name_Len)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::AudioOutputCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.RenameOutput(nullptr, nullptr, index, chip::ByteSpan(name, name_Len));
}
CHIP_ERROR chip_ime_AppendCommand_AudioOutput_SelectOutput(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                           chip::GroupId, uint8_t index)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::AudioOutputCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.SelectOutput(nullptr, nullptr, index);
}

CHIP_ERROR chip_ime_ReadAttribute_AudioOutput_AudioOutputList(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                              chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::AudioOutputCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeAudioOutputList(gAudioOutputAudioOutputListListAttributeCallback.Cancel(),
                                                gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_AudioOutput_CurrentAudioOutput(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                                 chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::AudioOutputCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeCurrentAudioOutput(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_AudioOutput_ClusterRevision(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                              chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::AudioOutputCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

// End of Cluster AudioOutput
// Cluster BarrierControl

CHIP_ERROR chip_ime_AppendCommand_BarrierControl_BarrierControlGoToPercent(chip::Controller::Device * device,
                                                                           chip::EndpointId ZCLendpointId, chip::GroupId,
                                                                           uint8_t percentOpen)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::BarrierControlCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.BarrierControlGoToPercent(nullptr, nullptr, percentOpen);
}
CHIP_ERROR chip_ime_AppendCommand_BarrierControl_BarrierControlStop(chip::Controller::Device * device,
                                                                    chip::EndpointId ZCLendpointId, chip::GroupId)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::BarrierControlCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.BarrierControlStop(nullptr, nullptr);
}

CHIP_ERROR chip_ime_ReadAttribute_BarrierControl_BarrierMovingState(chip::Controller::Device * device,
                                                                    chip::EndpointId ZCLendpointId, chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::BarrierControlCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeBarrierMovingState(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_BarrierControl_BarrierSafetyStatus(chip::Controller::Device * device,
                                                                     chip::EndpointId ZCLendpointId, chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::BarrierControlCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeBarrierSafetyStatus(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_BarrierControl_BarrierCapabilities(chip::Controller::Device * device,
                                                                     chip::EndpointId ZCLendpointId, chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::BarrierControlCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeBarrierCapabilities(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_BarrierControl_BarrierPosition(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                                 chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::BarrierControlCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeBarrierPosition(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_BarrierControl_ClusterRevision(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                                 chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::BarrierControlCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

// End of Cluster BarrierControl
// Cluster Basic

CHIP_ERROR chip_ime_AppendCommand_Basic_MfgSpecificPing(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                        chip::GroupId)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::BasicCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.MfgSpecificPing(nullptr, nullptr);
}

CHIP_ERROR chip_ime_ReadAttribute_Basic_InteractionModelVersion(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                                chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::BasicCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeInteractionModelVersion(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_Basic_VendorName(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                   chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::BasicCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeVendorName(gStringAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_Basic_VendorID(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                 chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::BasicCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeVendorID(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_Basic_ProductName(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                    chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::BasicCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeProductName(gStringAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_Basic_ProductID(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                  chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::BasicCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeProductID(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_Basic_UserLabel(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                  chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::BasicCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeUserLabel(gStringAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_WriteAttribute_Basic_UserLabel(chip::Controller::Device * device, chip::EndpointId ZCLendpointId, chip::GroupId,
                                                   uint8_t * value, size_t len)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::BasicCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.WriteAttributeUserLabel(gDefaultSuccessCallback.Cancel(), gDefaultFailureCallback.Cancel(),
                                           chip::ByteSpan(value, len));
}
CHIP_ERROR chip_ime_ReadAttribute_Basic_Location(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                 chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::BasicCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeLocation(gStringAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_WriteAttribute_Basic_Location(chip::Controller::Device * device, chip::EndpointId ZCLendpointId, chip::GroupId,
                                                  uint8_t * value, size_t len)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::BasicCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.WriteAttributeLocation(gDefaultSuccessCallback.Cancel(), gDefaultFailureCallback.Cancel(),
                                          chip::ByteSpan(value, len));
}
CHIP_ERROR chip_ime_ReadAttribute_Basic_HardwareVersion(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                        chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::BasicCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeHardwareVersion(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_Basic_HardwareVersionString(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                              chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::BasicCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeHardwareVersionString(gStringAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_Basic_SoftwareVersion(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                        chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::BasicCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeSoftwareVersion(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_Basic_SoftwareVersionString(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                              chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::BasicCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeSoftwareVersionString(gStringAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_Basic_ManufacturingDate(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                          chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::BasicCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeManufacturingDate(gStringAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_Basic_PartNumber(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                   chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::BasicCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributePartNumber(gStringAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_Basic_ProductURL(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                   chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::BasicCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeProductURL(gStringAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_Basic_ProductLabel(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                     chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::BasicCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeProductLabel(gStringAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_Basic_SerialNumber(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                     chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::BasicCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeSerialNumber(gStringAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_Basic_LocalConfigDisabled(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                            chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::BasicCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeLocalConfigDisabled(gBooleanAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_WriteAttribute_Basic_LocalConfigDisabled(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                             chip::GroupId, uint8_t value)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::BasicCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.WriteAttributeLocalConfigDisabled(gDefaultSuccessCallback.Cancel(), gDefaultFailureCallback.Cancel(), value);
}
CHIP_ERROR chip_ime_ReadAttribute_Basic_Reachable(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                  chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::BasicCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeReachable(gBooleanAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_Basic_ClusterRevision(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                        chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::BasicCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

// End of Cluster Basic
// Cluster BinaryInputBasic

CHIP_ERROR chip_ime_ReadAttribute_BinaryInputBasic_OutOfService(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                                chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::BinaryInputBasicCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeOutOfService(gBooleanAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_WriteAttribute_BinaryInputBasic_OutOfService(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                                 chip::GroupId, uint8_t value)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::BinaryInputBasicCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.WriteAttributeOutOfService(gDefaultSuccessCallback.Cancel(), gDefaultFailureCallback.Cancel(), value);
}
CHIP_ERROR chip_ime_ReadAttribute_BinaryInputBasic_PresentValue(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                                chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::BinaryInputBasicCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributePresentValue(gBooleanAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ConfigureAttribute_BinaryInputBasic_PresentValue(chip::Controller::Device * device,
                                                                     chip::EndpointId ZCLendpointId, uint16_t minInterval,
                                                                     uint16_t maxInterval)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::BinaryInputBasicCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ConfigureAttributePresentValue(gBooleanAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval,
                                                  maxInterval);
}

CHIP_ERROR chip_ime_WriteAttribute_BinaryInputBasic_PresentValue(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                                 chip::GroupId, uint8_t value)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::BinaryInputBasicCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.WriteAttributePresentValue(gDefaultSuccessCallback.Cancel(), gDefaultFailureCallback.Cancel(), value);
}
CHIP_ERROR chip_ime_ReadAttribute_BinaryInputBasic_StatusFlags(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                               chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::BinaryInputBasicCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeStatusFlags(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ConfigureAttribute_BinaryInputBasic_StatusFlags(chip::Controller::Device * device,
                                                                    chip::EndpointId ZCLendpointId, uint16_t minInterval,
                                                                    uint16_t maxInterval)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::BinaryInputBasicCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ConfigureAttributeStatusFlags(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval,
                                                 maxInterval);
}

CHIP_ERROR chip_ime_ReadAttribute_BinaryInputBasic_ClusterRevision(chip::Controller::Device * device,
                                                                   chip::EndpointId ZCLendpointId, chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::BinaryInputBasicCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

// End of Cluster BinaryInputBasic
// Cluster Binding

CHIP_ERROR chip_ime_AppendCommand_Binding_Bind(chip::Controller::Device * device, chip::EndpointId ZCLendpointId, chip::GroupId,
                                               chip::NodeId nodeId, chip::GroupId groupId, chip::EndpointId endpointId,
                                               chip::ClusterId clusterId)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::BindingCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.Bind(nullptr, nullptr, nodeId, groupId, endpointId, clusterId);
}
CHIP_ERROR chip_ime_AppendCommand_Binding_Unbind(chip::Controller::Device * device, chip::EndpointId ZCLendpointId, chip::GroupId,
                                                 chip::NodeId nodeId, chip::GroupId groupId, chip::EndpointId endpointId,
                                                 chip::ClusterId clusterId)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::BindingCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.Unbind(nullptr, nullptr, nodeId, groupId, endpointId, clusterId);
}

CHIP_ERROR chip_ime_ReadAttribute_Binding_ClusterRevision(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                          chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::BindingCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

// End of Cluster Binding
// Cluster BridgedDeviceBasic

CHIP_ERROR chip_ime_ReadAttribute_BridgedDeviceBasic_VendorName(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                                chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::BridgedDeviceBasicCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeVendorName(gStringAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_BridgedDeviceBasic_VendorID(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                              chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::BridgedDeviceBasicCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeVendorID(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_BridgedDeviceBasic_ProductName(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                                 chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::BridgedDeviceBasicCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeProductName(gStringAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_BridgedDeviceBasic_UserLabel(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                               chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::BridgedDeviceBasicCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeUserLabel(gStringAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_WriteAttribute_BridgedDeviceBasic_UserLabel(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                                chip::GroupId, uint8_t * value, size_t len)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::BridgedDeviceBasicCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.WriteAttributeUserLabel(gDefaultSuccessCallback.Cancel(), gDefaultFailureCallback.Cancel(),
                                           chip::ByteSpan(value, len));
}
CHIP_ERROR chip_ime_ReadAttribute_BridgedDeviceBasic_HardwareVersion(chip::Controller::Device * device,
                                                                     chip::EndpointId ZCLendpointId, chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::BridgedDeviceBasicCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeHardwareVersion(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_BridgedDeviceBasic_HardwareVersionString(chip::Controller::Device * device,
                                                                           chip::EndpointId ZCLendpointId,
                                                                           chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::BridgedDeviceBasicCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeHardwareVersionString(gStringAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_BridgedDeviceBasic_SoftwareVersion(chip::Controller::Device * device,
                                                                     chip::EndpointId ZCLendpointId, chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::BridgedDeviceBasicCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeSoftwareVersion(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_BridgedDeviceBasic_SoftwareVersionString(chip::Controller::Device * device,
                                                                           chip::EndpointId ZCLendpointId,
                                                                           chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::BridgedDeviceBasicCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeSoftwareVersionString(gStringAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_BridgedDeviceBasic_ManufacturingDate(chip::Controller::Device * device,
                                                                       chip::EndpointId ZCLendpointId,
                                                                       chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::BridgedDeviceBasicCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeManufacturingDate(gStringAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_BridgedDeviceBasic_PartNumber(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                                chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::BridgedDeviceBasicCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributePartNumber(gStringAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_BridgedDeviceBasic_ProductURL(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                                chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::BridgedDeviceBasicCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeProductURL(gStringAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_BridgedDeviceBasic_ProductLabel(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                                  chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::BridgedDeviceBasicCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeProductLabel(gStringAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_BridgedDeviceBasic_SerialNumber(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                                  chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::BridgedDeviceBasicCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeSerialNumber(gStringAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_BridgedDeviceBasic_Reachable(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                               chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::BridgedDeviceBasicCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeReachable(gBooleanAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_BridgedDeviceBasic_ClusterRevision(chip::Controller::Device * device,
                                                                     chip::EndpointId ZCLendpointId, chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::BridgedDeviceBasicCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

// End of Cluster BridgedDeviceBasic
// Cluster ColorControl

CHIP_ERROR chip_ime_AppendCommand_ColorControl_ColorLoopSet(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                            chip::GroupId, uint8_t updateFlags, uint8_t action, uint8_t direction,
                                                            uint16_t time, uint16_t startHue, uint8_t optionsMask,
                                                            uint8_t optionsOverride)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ColorControlCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ColorLoopSet(nullptr, nullptr, updateFlags, action, direction, time, startHue, optionsMask, optionsOverride);
}
CHIP_ERROR chip_ime_AppendCommand_ColorControl_EnhancedMoveHue(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                               chip::GroupId, uint8_t moveMode, uint16_t rate, uint8_t optionsMask,
                                                               uint8_t optionsOverride)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ColorControlCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.EnhancedMoveHue(nullptr, nullptr, moveMode, rate, optionsMask, optionsOverride);
}
CHIP_ERROR chip_ime_AppendCommand_ColorControl_EnhancedMoveToHue(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                                 chip::GroupId, uint16_t enhancedHue, uint8_t direction,
                                                                 uint16_t transitionTime, uint8_t optionsMask,
                                                                 uint8_t optionsOverride)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ColorControlCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.EnhancedMoveToHue(nullptr, nullptr, enhancedHue, direction, transitionTime, optionsMask, optionsOverride);
}
CHIP_ERROR chip_ime_AppendCommand_ColorControl_EnhancedMoveToHueAndSaturation(chip::Controller::Device * device,
                                                                              chip::EndpointId ZCLendpointId, chip::GroupId,
                                                                              uint16_t enhancedHue, uint8_t saturation,
                                                                              uint16_t transitionTime, uint8_t optionsMask,
                                                                              uint8_t optionsOverride)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ColorControlCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.EnhancedMoveToHueAndSaturation(nullptr, nullptr, enhancedHue, saturation, transitionTime, optionsMask,
                                                  optionsOverride);
}
CHIP_ERROR chip_ime_AppendCommand_ColorControl_EnhancedStepHue(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                               chip::GroupId, uint8_t stepMode, uint16_t stepSize,
                                                               uint16_t transitionTime, uint8_t optionsMask,
                                                               uint8_t optionsOverride)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ColorControlCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.EnhancedStepHue(nullptr, nullptr, stepMode, stepSize, transitionTime, optionsMask, optionsOverride);
}
CHIP_ERROR chip_ime_AppendCommand_ColorControl_MoveColor(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                         chip::GroupId, int16_t rateX, int16_t rateY, uint8_t optionsMask,
                                                         uint8_t optionsOverride)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ColorControlCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.MoveColor(nullptr, nullptr, rateX, rateY, optionsMask, optionsOverride);
}
CHIP_ERROR chip_ime_AppendCommand_ColorControl_MoveColorTemperature(chip::Controller::Device * device,
                                                                    chip::EndpointId ZCLendpointId, chip::GroupId, uint8_t moveMode,
                                                                    uint16_t rate, uint16_t colorTemperatureMinimum,
                                                                    uint16_t colorTemperatureMaximum, uint8_t optionsMask,
                                                                    uint8_t optionsOverride)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ColorControlCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.MoveColorTemperature(nullptr, nullptr, moveMode, rate, colorTemperatureMinimum, colorTemperatureMaximum,
                                        optionsMask, optionsOverride);
}
CHIP_ERROR chip_ime_AppendCommand_ColorControl_MoveHue(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                       chip::GroupId, uint8_t moveMode, uint8_t rate, uint8_t optionsMask,
                                                       uint8_t optionsOverride)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ColorControlCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.MoveHue(nullptr, nullptr, moveMode, rate, optionsMask, optionsOverride);
}
CHIP_ERROR chip_ime_AppendCommand_ColorControl_MoveSaturation(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                              chip::GroupId, uint8_t moveMode, uint8_t rate, uint8_t optionsMask,
                                                              uint8_t optionsOverride)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ColorControlCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.MoveSaturation(nullptr, nullptr, moveMode, rate, optionsMask, optionsOverride);
}
CHIP_ERROR chip_ime_AppendCommand_ColorControl_MoveToColor(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                           chip::GroupId, uint16_t colorX, uint16_t colorY, uint16_t transitionTime,
                                                           uint8_t optionsMask, uint8_t optionsOverride)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ColorControlCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.MoveToColor(nullptr, nullptr, colorX, colorY, transitionTime, optionsMask, optionsOverride);
}
CHIP_ERROR chip_ime_AppendCommand_ColorControl_MoveToColorTemperature(chip::Controller::Device * device,
                                                                      chip::EndpointId ZCLendpointId, chip::GroupId,
                                                                      uint16_t colorTemperature, uint16_t transitionTime,
                                                                      uint8_t optionsMask, uint8_t optionsOverride)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ColorControlCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.MoveToColorTemperature(nullptr, nullptr, colorTemperature, transitionTime, optionsMask, optionsOverride);
}
CHIP_ERROR chip_ime_AppendCommand_ColorControl_MoveToHue(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                         chip::GroupId, uint8_t hue, uint8_t direction, uint16_t transitionTime,
                                                         uint8_t optionsMask, uint8_t optionsOverride)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ColorControlCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.MoveToHue(nullptr, nullptr, hue, direction, transitionTime, optionsMask, optionsOverride);
}
CHIP_ERROR chip_ime_AppendCommand_ColorControl_MoveToHueAndSaturation(chip::Controller::Device * device,
                                                                      chip::EndpointId ZCLendpointId, chip::GroupId, uint8_t hue,
                                                                      uint8_t saturation, uint16_t transitionTime,
                                                                      uint8_t optionsMask, uint8_t optionsOverride)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ColorControlCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.MoveToHueAndSaturation(nullptr, nullptr, hue, saturation, transitionTime, optionsMask, optionsOverride);
}
CHIP_ERROR chip_ime_AppendCommand_ColorControl_MoveToSaturation(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                                chip::GroupId, uint8_t saturation, uint16_t transitionTime,
                                                                uint8_t optionsMask, uint8_t optionsOverride)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ColorControlCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.MoveToSaturation(nullptr, nullptr, saturation, transitionTime, optionsMask, optionsOverride);
}
CHIP_ERROR chip_ime_AppendCommand_ColorControl_StepColor(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                         chip::GroupId, int16_t stepX, int16_t stepY, uint16_t transitionTime,
                                                         uint8_t optionsMask, uint8_t optionsOverride)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ColorControlCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.StepColor(nullptr, nullptr, stepX, stepY, transitionTime, optionsMask, optionsOverride);
}
CHIP_ERROR chip_ime_AppendCommand_ColorControl_StepColorTemperature(chip::Controller::Device * device,
                                                                    chip::EndpointId ZCLendpointId, chip::GroupId, uint8_t stepMode,
                                                                    uint16_t stepSize, uint16_t transitionTime,
                                                                    uint16_t colorTemperatureMinimum,
                                                                    uint16_t colorTemperatureMaximum, uint8_t optionsMask,
                                                                    uint8_t optionsOverride)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ColorControlCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.StepColorTemperature(nullptr, nullptr, stepMode, stepSize, transitionTime, colorTemperatureMinimum,
                                        colorTemperatureMaximum, optionsMask, optionsOverride);
}
CHIP_ERROR chip_ime_AppendCommand_ColorControl_StepHue(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                       chip::GroupId, uint8_t stepMode, uint8_t stepSize, uint8_t transitionTime,
                                                       uint8_t optionsMask, uint8_t optionsOverride)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ColorControlCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.StepHue(nullptr, nullptr, stepMode, stepSize, transitionTime, optionsMask, optionsOverride);
}
CHIP_ERROR chip_ime_AppendCommand_ColorControl_StepSaturation(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                              chip::GroupId, uint8_t stepMode, uint8_t stepSize,
                                                              uint8_t transitionTime, uint8_t optionsMask, uint8_t optionsOverride)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ColorControlCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.StepSaturation(nullptr, nullptr, stepMode, stepSize, transitionTime, optionsMask, optionsOverride);
}
CHIP_ERROR chip_ime_AppendCommand_ColorControl_StopMoveStep(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                            chip::GroupId, uint8_t optionsMask, uint8_t optionsOverride)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ColorControlCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.StopMoveStep(nullptr, nullptr, optionsMask, optionsOverride);
}

CHIP_ERROR chip_ime_ReadAttribute_ColorControl_CurrentHue(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                          chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ColorControlCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeCurrentHue(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ConfigureAttribute_ColorControl_CurrentHue(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                               uint16_t minInterval, uint16_t maxInterval, uint8_t change)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ColorControlCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ConfigureAttributeCurrentHue(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval,
                                                maxInterval, change);
}

CHIP_ERROR chip_ime_ReadAttribute_ColorControl_CurrentSaturation(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                                 chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ColorControlCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeCurrentSaturation(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ConfigureAttribute_ColorControl_CurrentSaturation(chip::Controller::Device * device,
                                                                      chip::EndpointId ZCLendpointId, uint16_t minInterval,
                                                                      uint16_t maxInterval, uint8_t change)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ColorControlCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ConfigureAttributeCurrentSaturation(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(),
                                                       minInterval, maxInterval, change);
}

CHIP_ERROR chip_ime_ReadAttribute_ColorControl_RemainingTime(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                             chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ColorControlCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeRemainingTime(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_ColorControl_CurrentX(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                        chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ColorControlCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeCurrentX(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ConfigureAttribute_ColorControl_CurrentX(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                             uint16_t minInterval, uint16_t maxInterval, uint16_t change)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ColorControlCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ConfigureAttributeCurrentX(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval,
                                              maxInterval, change);
}

CHIP_ERROR chip_ime_ReadAttribute_ColorControl_CurrentY(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                        chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ColorControlCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeCurrentY(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ConfigureAttribute_ColorControl_CurrentY(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                             uint16_t minInterval, uint16_t maxInterval, uint16_t change)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ColorControlCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ConfigureAttributeCurrentY(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval,
                                              maxInterval, change);
}

CHIP_ERROR chip_ime_ReadAttribute_ColorControl_DriftCompensation(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                                 chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ColorControlCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeDriftCompensation(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_ColorControl_CompensationText(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                                chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ColorControlCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeCompensationText(gStringAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_ColorControl_ColorTemperature(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                                chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ColorControlCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeColorTemperature(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ConfigureAttribute_ColorControl_ColorTemperature(chip::Controller::Device * device,
                                                                     chip::EndpointId ZCLendpointId, uint16_t minInterval,
                                                                     uint16_t maxInterval, uint16_t change)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ColorControlCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ConfigureAttributeColorTemperature(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(),
                                                      minInterval, maxInterval, change);
}

CHIP_ERROR chip_ime_ReadAttribute_ColorControl_ColorMode(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                         chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ColorControlCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeColorMode(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_ColorControl_ColorControlOptions(chip::Controller::Device * device,
                                                                   chip::EndpointId ZCLendpointId, chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ColorControlCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeColorControlOptions(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_WriteAttribute_ColorControl_ColorControlOptions(chip::Controller::Device * device,
                                                                    chip::EndpointId ZCLendpointId, chip::GroupId, uint8_t value)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ColorControlCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.WriteAttributeColorControlOptions(gDefaultSuccessCallback.Cancel(), gDefaultFailureCallback.Cancel(), value);
}
CHIP_ERROR chip_ime_ReadAttribute_ColorControl_NumberOfPrimaries(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                                 chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ColorControlCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeNumberOfPrimaries(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_ColorControl_Primary1X(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                         chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ColorControlCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributePrimary1X(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_ColorControl_Primary1Y(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                         chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ColorControlCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributePrimary1Y(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_ColorControl_Primary1Intensity(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                                 chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ColorControlCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributePrimary1Intensity(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_ColorControl_Primary2X(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                         chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ColorControlCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributePrimary2X(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_ColorControl_Primary2Y(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                         chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ColorControlCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributePrimary2Y(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_ColorControl_Primary2Intensity(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                                 chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ColorControlCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributePrimary2Intensity(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_ColorControl_Primary3X(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                         chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ColorControlCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributePrimary3X(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_ColorControl_Primary3Y(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                         chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ColorControlCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributePrimary3Y(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_ColorControl_Primary3Intensity(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                                 chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ColorControlCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributePrimary3Intensity(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_ColorControl_Primary4X(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                         chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ColorControlCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributePrimary4X(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_ColorControl_Primary4Y(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                         chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ColorControlCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributePrimary4Y(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_ColorControl_Primary4Intensity(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                                 chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ColorControlCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributePrimary4Intensity(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_ColorControl_Primary5X(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                         chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ColorControlCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributePrimary5X(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_ColorControl_Primary5Y(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                         chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ColorControlCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributePrimary5Y(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_ColorControl_Primary5Intensity(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                                 chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ColorControlCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributePrimary5Intensity(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_ColorControl_Primary6X(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                         chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ColorControlCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributePrimary6X(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_ColorControl_Primary6Y(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                         chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ColorControlCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributePrimary6Y(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_ColorControl_Primary6Intensity(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                                 chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ColorControlCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributePrimary6Intensity(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_ColorControl_WhitePointX(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                           chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ColorControlCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeWhitePointX(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_WriteAttribute_ColorControl_WhitePointX(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                            chip::GroupId, uint16_t value)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ColorControlCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.WriteAttributeWhitePointX(gDefaultSuccessCallback.Cancel(), gDefaultFailureCallback.Cancel(), value);
}
CHIP_ERROR chip_ime_ReadAttribute_ColorControl_WhitePointY(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                           chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ColorControlCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeWhitePointY(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_WriteAttribute_ColorControl_WhitePointY(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                            chip::GroupId, uint16_t value)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ColorControlCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.WriteAttributeWhitePointY(gDefaultSuccessCallback.Cancel(), gDefaultFailureCallback.Cancel(), value);
}
CHIP_ERROR chip_ime_ReadAttribute_ColorControl_ColorPointRX(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                            chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ColorControlCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeColorPointRX(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_WriteAttribute_ColorControl_ColorPointRX(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                             chip::GroupId, uint16_t value)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ColorControlCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.WriteAttributeColorPointRX(gDefaultSuccessCallback.Cancel(), gDefaultFailureCallback.Cancel(), value);
}
CHIP_ERROR chip_ime_ReadAttribute_ColorControl_ColorPointRY(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                            chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ColorControlCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeColorPointRY(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_WriteAttribute_ColorControl_ColorPointRY(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                             chip::GroupId, uint16_t value)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ColorControlCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.WriteAttributeColorPointRY(gDefaultSuccessCallback.Cancel(), gDefaultFailureCallback.Cancel(), value);
}
CHIP_ERROR chip_ime_ReadAttribute_ColorControl_ColorPointRIntensity(chip::Controller::Device * device,
                                                                    chip::EndpointId ZCLendpointId, chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ColorControlCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeColorPointRIntensity(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_WriteAttribute_ColorControl_ColorPointRIntensity(chip::Controller::Device * device,
                                                                     chip::EndpointId ZCLendpointId, chip::GroupId, uint8_t value)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ColorControlCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.WriteAttributeColorPointRIntensity(gDefaultSuccessCallback.Cancel(), gDefaultFailureCallback.Cancel(), value);
}
CHIP_ERROR chip_ime_ReadAttribute_ColorControl_ColorPointGX(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                            chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ColorControlCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeColorPointGX(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_WriteAttribute_ColorControl_ColorPointGX(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                             chip::GroupId, uint16_t value)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ColorControlCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.WriteAttributeColorPointGX(gDefaultSuccessCallback.Cancel(), gDefaultFailureCallback.Cancel(), value);
}
CHIP_ERROR chip_ime_ReadAttribute_ColorControl_ColorPointGY(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                            chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ColorControlCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeColorPointGY(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_WriteAttribute_ColorControl_ColorPointGY(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                             chip::GroupId, uint16_t value)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ColorControlCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.WriteAttributeColorPointGY(gDefaultSuccessCallback.Cancel(), gDefaultFailureCallback.Cancel(), value);
}
CHIP_ERROR chip_ime_ReadAttribute_ColorControl_ColorPointGIntensity(chip::Controller::Device * device,
                                                                    chip::EndpointId ZCLendpointId, chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ColorControlCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeColorPointGIntensity(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_WriteAttribute_ColorControl_ColorPointGIntensity(chip::Controller::Device * device,
                                                                     chip::EndpointId ZCLendpointId, chip::GroupId, uint8_t value)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ColorControlCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.WriteAttributeColorPointGIntensity(gDefaultSuccessCallback.Cancel(), gDefaultFailureCallback.Cancel(), value);
}
CHIP_ERROR chip_ime_ReadAttribute_ColorControl_ColorPointBX(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                            chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ColorControlCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeColorPointBX(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_WriteAttribute_ColorControl_ColorPointBX(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                             chip::GroupId, uint16_t value)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ColorControlCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.WriteAttributeColorPointBX(gDefaultSuccessCallback.Cancel(), gDefaultFailureCallback.Cancel(), value);
}
CHIP_ERROR chip_ime_ReadAttribute_ColorControl_ColorPointBY(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                            chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ColorControlCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeColorPointBY(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_WriteAttribute_ColorControl_ColorPointBY(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                             chip::GroupId, uint16_t value)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ColorControlCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.WriteAttributeColorPointBY(gDefaultSuccessCallback.Cancel(), gDefaultFailureCallback.Cancel(), value);
}
CHIP_ERROR chip_ime_ReadAttribute_ColorControl_ColorPointBIntensity(chip::Controller::Device * device,
                                                                    chip::EndpointId ZCLendpointId, chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ColorControlCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeColorPointBIntensity(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_WriteAttribute_ColorControl_ColorPointBIntensity(chip::Controller::Device * device,
                                                                     chip::EndpointId ZCLendpointId, chip::GroupId, uint8_t value)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ColorControlCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.WriteAttributeColorPointBIntensity(gDefaultSuccessCallback.Cancel(), gDefaultFailureCallback.Cancel(), value);
}
CHIP_ERROR chip_ime_ReadAttribute_ColorControl_EnhancedCurrentHue(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                                  chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ColorControlCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeEnhancedCurrentHue(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_ColorControl_EnhancedColorMode(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                                 chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ColorControlCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeEnhancedColorMode(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_ColorControl_ColorLoopActive(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                               chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ColorControlCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeColorLoopActive(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_ColorControl_ColorLoopDirection(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                                  chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ColorControlCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeColorLoopDirection(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_ColorControl_ColorLoopTime(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                             chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ColorControlCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeColorLoopTime(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_ColorControl_ColorCapabilities(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                                 chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ColorControlCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeColorCapabilities(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_ColorControl_ColorTempPhysicalMin(chip::Controller::Device * device,
                                                                    chip::EndpointId ZCLendpointId, chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ColorControlCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeColorTempPhysicalMin(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_ColorControl_ColorTempPhysicalMax(chip::Controller::Device * device,
                                                                    chip::EndpointId ZCLendpointId, chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ColorControlCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeColorTempPhysicalMax(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_ColorControl_CoupleColorTempToLevelMinMireds(chip::Controller::Device * device,
                                                                               chip::EndpointId ZCLendpointId,
                                                                               chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ColorControlCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeCoupleColorTempToLevelMinMireds(gInt16uAttributeCallback.Cancel(),
                                                                gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_ColorControl_StartUpColorTemperatureMireds(chip::Controller::Device * device,
                                                                             chip::EndpointId ZCLendpointId,
                                                                             chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ColorControlCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeStartUpColorTemperatureMireds(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_WriteAttribute_ColorControl_StartUpColorTemperatureMireds(chip::Controller::Device * device,
                                                                              chip::EndpointId ZCLendpointId, chip::GroupId,
                                                                              uint16_t value)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ColorControlCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.WriteAttributeStartUpColorTemperatureMireds(gDefaultSuccessCallback.Cancel(), gDefaultFailureCallback.Cancel(),
                                                               value);
}
CHIP_ERROR chip_ime_ReadAttribute_ColorControl_ClusterRevision(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                               chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ColorControlCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

// End of Cluster ColorControl
// Cluster ContentLauncher

CHIP_ERROR chip_ime_AppendCommand_ContentLauncher_LaunchContent(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                                chip::GroupId, uint8_t autoPlay, const uint8_t * data,
                                                                uint32_t data_Len)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ContentLauncherCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.LaunchContent(nullptr, nullptr, autoPlay, chip::ByteSpan(data, data_Len));
}
CHIP_ERROR chip_ime_AppendCommand_ContentLauncher_LaunchURL(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                            chip::GroupId, const uint8_t * contentURL, uint32_t contentURL_Len,
                                                            const uint8_t * displayString, uint32_t displayString_Len)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ContentLauncherCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.LaunchURL(nullptr, nullptr, chip::ByteSpan(contentURL, contentURL_Len),
                             chip::ByteSpan(displayString, displayString_Len));
}

CHIP_ERROR chip_ime_ReadAttribute_ContentLauncher_AcceptsHeaderList(chip::Controller::Device * device,
                                                                    chip::EndpointId ZCLendpointId, chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ContentLauncherCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeAcceptsHeaderList(gContentLauncherAcceptsHeaderListListAttributeCallback.Cancel(),
                                                  gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_ContentLauncher_SupportedStreamingTypes(chip::Controller::Device * device,
                                                                          chip::EndpointId ZCLendpointId,
                                                                          chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ContentLauncherCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeSupportedStreamingTypes(gContentLauncherSupportedStreamingTypesListAttributeCallback.Cancel(),
                                                        gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_ContentLauncher_ClusterRevision(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                                  chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ContentLauncherCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

// End of Cluster ContentLauncher
// Cluster Descriptor

CHIP_ERROR chip_ime_ReadAttribute_Descriptor_DeviceList(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                        chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::DescriptorCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeDeviceList(gDescriptorDeviceListListAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_Descriptor_ServerList(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                        chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::DescriptorCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeServerList(gDescriptorServerListListAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_Descriptor_ClientList(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                        chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::DescriptorCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeClientList(gDescriptorClientListListAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_Descriptor_PartsList(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                       chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::DescriptorCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributePartsList(gDescriptorPartsListListAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_Descriptor_ClusterRevision(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                             chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::DescriptorCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

// End of Cluster Descriptor
// Cluster DiagnosticLogs

CHIP_ERROR chip_ime_AppendCommand_DiagnosticLogs_RetrieveLogsRequest(chip::Controller::Device * device,
                                                                     chip::EndpointId ZCLendpointId, chip::GroupId, uint8_t intent,
                                                                     uint8_t requestedProtocol,
                                                                     const uint8_t * transferFileDesignator,
                                                                     uint32_t transferFileDesignator_Len)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::DiagnosticLogsCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.RetrieveLogsRequest(nullptr, nullptr, intent, requestedProtocol,
                                       chip::ByteSpan(transferFileDesignator, transferFileDesignator_Len));
}

// End of Cluster DiagnosticLogs
// Cluster DoorLock

CHIP_ERROR chip_ime_AppendCommand_DoorLock_ClearAllPins(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                        chip::GroupId)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::DoorLockCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ClearAllPins(nullptr, nullptr);
}
CHIP_ERROR chip_ime_AppendCommand_DoorLock_ClearAllRfids(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                         chip::GroupId)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::DoorLockCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ClearAllRfids(nullptr, nullptr);
}
CHIP_ERROR chip_ime_AppendCommand_DoorLock_ClearHolidaySchedule(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                                chip::GroupId, uint8_t scheduleId)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::DoorLockCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ClearHolidaySchedule(nullptr, nullptr, scheduleId);
}
CHIP_ERROR chip_ime_AppendCommand_DoorLock_ClearPin(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                    chip::GroupId, uint16_t userId)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::DoorLockCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ClearPin(nullptr, nullptr, userId);
}
CHIP_ERROR chip_ime_AppendCommand_DoorLock_ClearRfid(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                     chip::GroupId, uint16_t userId)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::DoorLockCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ClearRfid(nullptr, nullptr, userId);
}
CHIP_ERROR chip_ime_AppendCommand_DoorLock_ClearWeekdaySchedule(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                                chip::GroupId, uint8_t scheduleId, uint16_t userId)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::DoorLockCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ClearWeekdaySchedule(nullptr, nullptr, scheduleId, userId);
}
CHIP_ERROR chip_ime_AppendCommand_DoorLock_ClearYeardaySchedule(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                                chip::GroupId, uint8_t scheduleId, uint16_t userId)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::DoorLockCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ClearYeardaySchedule(nullptr, nullptr, scheduleId, userId);
}
CHIP_ERROR chip_ime_AppendCommand_DoorLock_GetHolidaySchedule(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                              chip::GroupId, uint8_t scheduleId)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::DoorLockCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.GetHolidaySchedule(nullptr, nullptr, scheduleId);
}
CHIP_ERROR chip_ime_AppendCommand_DoorLock_GetLogRecord(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                        chip::GroupId, uint16_t logIndex)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::DoorLockCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.GetLogRecord(nullptr, nullptr, logIndex);
}
CHIP_ERROR chip_ime_AppendCommand_DoorLock_GetPin(chip::Controller::Device * device, chip::EndpointId ZCLendpointId, chip::GroupId,
                                                  uint16_t userId)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::DoorLockCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.GetPin(nullptr, nullptr, userId);
}
CHIP_ERROR chip_ime_AppendCommand_DoorLock_GetRfid(chip::Controller::Device * device, chip::EndpointId ZCLendpointId, chip::GroupId,
                                                   uint16_t userId)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::DoorLockCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.GetRfid(nullptr, nullptr, userId);
}
CHIP_ERROR chip_ime_AppendCommand_DoorLock_GetUserType(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                       chip::GroupId, uint16_t userId)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::DoorLockCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.GetUserType(nullptr, nullptr, userId);
}
CHIP_ERROR chip_ime_AppendCommand_DoorLock_GetWeekdaySchedule(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                              chip::GroupId, uint8_t scheduleId, uint16_t userId)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::DoorLockCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.GetWeekdaySchedule(nullptr, nullptr, scheduleId, userId);
}
CHIP_ERROR chip_ime_AppendCommand_DoorLock_GetYeardaySchedule(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                              chip::GroupId, uint8_t scheduleId, uint16_t userId)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::DoorLockCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.GetYeardaySchedule(nullptr, nullptr, scheduleId, userId);
}
CHIP_ERROR chip_ime_AppendCommand_DoorLock_LockDoor(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                    chip::GroupId, const uint8_t * pin, uint32_t pin_Len)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::DoorLockCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.LockDoor(nullptr, nullptr, chip::ByteSpan(pin, pin_Len));
}
CHIP_ERROR chip_ime_AppendCommand_DoorLock_SetHolidaySchedule(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                              chip::GroupId, uint8_t scheduleId, uint32_t localStartTime,
                                                              uint32_t localEndTime, uint8_t operatingModeDuringHoliday)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::DoorLockCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.SetHolidaySchedule(nullptr, nullptr, scheduleId, localStartTime, localEndTime, operatingModeDuringHoliday);
}
CHIP_ERROR chip_ime_AppendCommand_DoorLock_SetPin(chip::Controller::Device * device, chip::EndpointId ZCLendpointId, chip::GroupId,
                                                  uint16_t userId, uint8_t userStatus, uint8_t userType, const uint8_t * pin,
                                                  uint32_t pin_Len)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::DoorLockCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.SetPin(nullptr, nullptr, userId, userStatus, userType, chip::ByteSpan(pin, pin_Len));
}
CHIP_ERROR chip_ime_AppendCommand_DoorLock_SetRfid(chip::Controller::Device * device, chip::EndpointId ZCLendpointId, chip::GroupId,
                                                   uint16_t userId, uint8_t userStatus, uint8_t userType, const uint8_t * id,
                                                   uint32_t id_Len)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::DoorLockCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.SetRfid(nullptr, nullptr, userId, userStatus, userType, chip::ByteSpan(id, id_Len));
}
CHIP_ERROR chip_ime_AppendCommand_DoorLock_SetUserType(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                       chip::GroupId, uint16_t userId, uint8_t userType)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::DoorLockCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.SetUserType(nullptr, nullptr, userId, userType);
}
CHIP_ERROR chip_ime_AppendCommand_DoorLock_SetWeekdaySchedule(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                              chip::GroupId, uint8_t scheduleId, uint16_t userId, uint8_t daysMask,
                                                              uint8_t startHour, uint8_t startMinute, uint8_t endHour,
                                                              uint8_t endMinute)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::DoorLockCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.SetWeekdaySchedule(nullptr, nullptr, scheduleId, userId, daysMask, startHour, startMinute, endHour, endMinute);
}
CHIP_ERROR chip_ime_AppendCommand_DoorLock_SetYeardaySchedule(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                              chip::GroupId, uint8_t scheduleId, uint16_t userId,
                                                              uint32_t localStartTime, uint32_t localEndTime)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::DoorLockCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.SetYeardaySchedule(nullptr, nullptr, scheduleId, userId, localStartTime, localEndTime);
}
CHIP_ERROR chip_ime_AppendCommand_DoorLock_UnlockDoor(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                      chip::GroupId, const uint8_t * pin, uint32_t pin_Len)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::DoorLockCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.UnlockDoor(nullptr, nullptr, chip::ByteSpan(pin, pin_Len));
}
CHIP_ERROR chip_ime_AppendCommand_DoorLock_UnlockWithTimeout(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                             chip::GroupId, uint16_t timeoutInSeconds, const uint8_t * pin,
                                                             uint32_t pin_Len)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::DoorLockCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.UnlockWithTimeout(nullptr, nullptr, timeoutInSeconds, chip::ByteSpan(pin, pin_Len));
}

CHIP_ERROR chip_ime_ReadAttribute_DoorLock_LockState(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                     chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::DoorLockCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeLockState(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ConfigureAttribute_DoorLock_LockState(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                          uint16_t minInterval, uint16_t maxInterval)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::DoorLockCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ConfigureAttributeLockState(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval,
                                               maxInterval);
}

CHIP_ERROR chip_ime_ReadAttribute_DoorLock_LockType(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                    chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::DoorLockCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeLockType(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_DoorLock_ActuatorEnabled(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                           chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::DoorLockCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeActuatorEnabled(gBooleanAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_DoorLock_ClusterRevision(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                           chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::DoorLockCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

// End of Cluster DoorLock
// Cluster ElectricalMeasurement

CHIP_ERROR chip_ime_ReadAttribute_ElectricalMeasurement_MeasurementType(chip::Controller::Device * device,
                                                                        chip::EndpointId ZCLendpointId,
                                                                        chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ElectricalMeasurementCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeMeasurementType(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_ElectricalMeasurement_TotalActivePower(chip::Controller::Device * device,
                                                                         chip::EndpointId ZCLendpointId,
                                                                         chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ElectricalMeasurementCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeTotalActivePower(gInt32sAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_ElectricalMeasurement_RmsVoltage(chip::Controller::Device * device,
                                                                   chip::EndpointId ZCLendpointId, chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ElectricalMeasurementCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeRmsVoltage(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_ElectricalMeasurement_RmsVoltageMin(chip::Controller::Device * device,
                                                                      chip::EndpointId ZCLendpointId,
                                                                      chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ElectricalMeasurementCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeRmsVoltageMin(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_ElectricalMeasurement_RmsVoltageMax(chip::Controller::Device * device,
                                                                      chip::EndpointId ZCLendpointId,
                                                                      chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ElectricalMeasurementCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeRmsVoltageMax(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_ElectricalMeasurement_RmsCurrent(chip::Controller::Device * device,
                                                                   chip::EndpointId ZCLendpointId, chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ElectricalMeasurementCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeRmsCurrent(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_ElectricalMeasurement_RmsCurrentMin(chip::Controller::Device * device,
                                                                      chip::EndpointId ZCLendpointId,
                                                                      chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ElectricalMeasurementCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeRmsCurrentMin(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_ElectricalMeasurement_RmsCurrentMax(chip::Controller::Device * device,
                                                                      chip::EndpointId ZCLendpointId,
                                                                      chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ElectricalMeasurementCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeRmsCurrentMax(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_ElectricalMeasurement_ActivePower(chip::Controller::Device * device,
                                                                    chip::EndpointId ZCLendpointId, chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ElectricalMeasurementCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeActivePower(gInt16sAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_ElectricalMeasurement_ActivePowerMin(chip::Controller::Device * device,
                                                                       chip::EndpointId ZCLendpointId,
                                                                       chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ElectricalMeasurementCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeActivePowerMin(gInt16sAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_ElectricalMeasurement_ActivePowerMax(chip::Controller::Device * device,
                                                                       chip::EndpointId ZCLendpointId,
                                                                       chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ElectricalMeasurementCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeActivePowerMax(gInt16sAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_ElectricalMeasurement_ClusterRevision(chip::Controller::Device * device,
                                                                        chip::EndpointId ZCLendpointId,
                                                                        chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ElectricalMeasurementCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

// End of Cluster ElectricalMeasurement
// Cluster EthernetNetworkDiagnostics

CHIP_ERROR chip_ime_AppendCommand_EthernetNetworkDiagnostics_ResetCounts(chip::Controller::Device * device,
                                                                         chip::EndpointId ZCLendpointId, chip::GroupId)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::EthernetNetworkDiagnosticsCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ResetCounts(nullptr, nullptr);
}

CHIP_ERROR chip_ime_ReadAttribute_EthernetNetworkDiagnostics_PacketRxCount(chip::Controller::Device * device,
                                                                           chip::EndpointId ZCLendpointId,
                                                                           chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::EthernetNetworkDiagnosticsCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributePacketRxCount(gInt64uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_EthernetNetworkDiagnostics_PacketTxCount(chip::Controller::Device * device,
                                                                           chip::EndpointId ZCLendpointId,
                                                                           chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::EthernetNetworkDiagnosticsCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributePacketTxCount(gInt64uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_EthernetNetworkDiagnostics_TxErrCount(chip::Controller::Device * device,
                                                                        chip::EndpointId ZCLendpointId,
                                                                        chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::EthernetNetworkDiagnosticsCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeTxErrCount(gInt64uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_EthernetNetworkDiagnostics_CollisionCount(chip::Controller::Device * device,
                                                                            chip::EndpointId ZCLendpointId,
                                                                            chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::EthernetNetworkDiagnosticsCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeCollisionCount(gInt64uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_EthernetNetworkDiagnostics_OverrunCount(chip::Controller::Device * device,
                                                                          chip::EndpointId ZCLendpointId,
                                                                          chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::EthernetNetworkDiagnosticsCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeOverrunCount(gInt64uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_EthernetNetworkDiagnostics_ClusterRevision(chip::Controller::Device * device,
                                                                             chip::EndpointId ZCLendpointId,
                                                                             chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::EthernetNetworkDiagnosticsCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

// End of Cluster EthernetNetworkDiagnostics
// Cluster FixedLabel

CHIP_ERROR chip_ime_ReadAttribute_FixedLabel_LabelList(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                       chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::FixedLabelCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeLabelList(gFixedLabelLabelListListAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_FixedLabel_ClusterRevision(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                             chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::FixedLabelCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

// End of Cluster FixedLabel
// Cluster FlowMeasurement

CHIP_ERROR chip_ime_ReadAttribute_FlowMeasurement_MeasuredValue(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                                chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::FlowMeasurementCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeMeasuredValue(gInt16sAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_FlowMeasurement_MinMeasuredValue(chip::Controller::Device * device,
                                                                   chip::EndpointId ZCLendpointId, chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::FlowMeasurementCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeMinMeasuredValue(gInt16sAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_FlowMeasurement_MaxMeasuredValue(chip::Controller::Device * device,
                                                                   chip::EndpointId ZCLendpointId, chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::FlowMeasurementCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeMaxMeasuredValue(gInt16sAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_FlowMeasurement_ClusterRevision(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                                  chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::FlowMeasurementCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

// End of Cluster FlowMeasurement
// Cluster GeneralCommissioning

CHIP_ERROR chip_ime_AppendCommand_GeneralCommissioning_ArmFailSafe(chip::Controller::Device * device,
                                                                   chip::EndpointId ZCLendpointId, chip::GroupId,
                                                                   uint16_t expiryLengthSeconds, uint64_t breadcrumb,
                                                                   uint32_t timeoutMs)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::GeneralCommissioningCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ArmFailSafe(nullptr, nullptr, expiryLengthSeconds, breadcrumb, timeoutMs);
}
CHIP_ERROR chip_ime_AppendCommand_GeneralCommissioning_CommissioningComplete(chip::Controller::Device * device,
                                                                             chip::EndpointId ZCLendpointId, chip::GroupId)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::GeneralCommissioningCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.CommissioningComplete(nullptr, nullptr);
}
CHIP_ERROR chip_ime_AppendCommand_GeneralCommissioning_SetRegulatoryConfig(chip::Controller::Device * device,
                                                                           chip::EndpointId ZCLendpointId, chip::GroupId,
                                                                           uint8_t location, const uint8_t * countryCode,
                                                                           uint32_t countryCode_Len, uint64_t breadcrumb,
                                                                           uint32_t timeoutMs)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::GeneralCommissioningCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.SetRegulatoryConfig(nullptr, nullptr, location, chip::ByteSpan(countryCode, countryCode_Len), breadcrumb,
                                       timeoutMs);
}

CHIP_ERROR chip_ime_ReadAttribute_GeneralCommissioning_FabricId(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                                chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::GeneralCommissioningCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeFabricId(gStringAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_GeneralCommissioning_Breadcrumb(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                                  chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::GeneralCommissioningCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeBreadcrumb(gInt64uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_WriteAttribute_GeneralCommissioning_Breadcrumb(chip::Controller::Device * device,
                                                                   chip::EndpointId ZCLendpointId, chip::GroupId, uint64_t value)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::GeneralCommissioningCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.WriteAttributeBreadcrumb(gDefaultSuccessCallback.Cancel(), gDefaultFailureCallback.Cancel(), value);
}
CHIP_ERROR chip_ime_ReadAttribute_GeneralCommissioning_ClusterRevision(chip::Controller::Device * device,
                                                                       chip::EndpointId ZCLendpointId,
                                                                       chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::GeneralCommissioningCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

// End of Cluster GeneralCommissioning
// Cluster GeneralDiagnostics

CHIP_ERROR chip_ime_ReadAttribute_GeneralDiagnostics_NetworkInterfaces(chip::Controller::Device * device,
                                                                       chip::EndpointId ZCLendpointId,
                                                                       chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::GeneralDiagnosticsCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeNetworkInterfaces(gGeneralDiagnosticsNetworkInterfacesListAttributeCallback.Cancel(),
                                                  gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_GeneralDiagnostics_RebootCount(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                                 chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::GeneralDiagnosticsCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeRebootCount(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_GeneralDiagnostics_ClusterRevision(chip::Controller::Device * device,
                                                                     chip::EndpointId ZCLendpointId, chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::GeneralDiagnosticsCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

// End of Cluster GeneralDiagnostics
// Cluster GroupKeyManagement

CHIP_ERROR chip_ime_ReadAttribute_GroupKeyManagement_Groups(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                            chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::GroupKeyManagementCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeGroups(gGroupKeyManagementGroupsListAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_GroupKeyManagement_GroupKeys(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                               chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::GroupKeyManagementCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeGroupKeys(gGroupKeyManagementGroupKeysListAttributeCallback.Cancel(),
                                          gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_GroupKeyManagement_ClusterRevision(chip::Controller::Device * device,
                                                                     chip::EndpointId ZCLendpointId, chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::GroupKeyManagementCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

// End of Cluster GroupKeyManagement
// Cluster Groups

CHIP_ERROR chip_ime_AppendCommand_Groups_AddGroup(chip::Controller::Device * device, chip::EndpointId ZCLendpointId, chip::GroupId,
                                                  uint16_t groupId, const uint8_t * groupName, uint32_t groupName_Len)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::GroupsCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.AddGroup(nullptr, nullptr, groupId, chip::ByteSpan(groupName, groupName_Len));
}
CHIP_ERROR chip_ime_AppendCommand_Groups_AddGroupIfIdentifying(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                               chip::GroupId, uint16_t groupId, const uint8_t * groupName,
                                                               uint32_t groupName_Len)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::GroupsCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.AddGroupIfIdentifying(nullptr, nullptr, groupId, chip::ByteSpan(groupName, groupName_Len));
}
CHIP_ERROR chip_ime_AppendCommand_Groups_GetGroupMembership(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                            chip::GroupId, uint8_t groupCount, uint16_t groupList)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::GroupsCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.GetGroupMembership(nullptr, nullptr, groupCount, groupList);
}
CHIP_ERROR chip_ime_AppendCommand_Groups_RemoveAllGroups(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                         chip::GroupId)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::GroupsCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.RemoveAllGroups(nullptr, nullptr);
}
CHIP_ERROR chip_ime_AppendCommand_Groups_RemoveGroup(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                     chip::GroupId, uint16_t groupId)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::GroupsCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.RemoveGroup(nullptr, nullptr, groupId);
}
CHIP_ERROR chip_ime_AppendCommand_Groups_ViewGroup(chip::Controller::Device * device, chip::EndpointId ZCLendpointId, chip::GroupId,
                                                   uint16_t groupId)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::GroupsCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ViewGroup(nullptr, nullptr, groupId);
}

CHIP_ERROR chip_ime_ReadAttribute_Groups_NameSupport(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                     chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::GroupsCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeNameSupport(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_Groups_ClusterRevision(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                         chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::GroupsCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

// End of Cluster Groups
// Cluster Identify

CHIP_ERROR chip_ime_AppendCommand_Identify_Identify(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                    chip::GroupId, uint16_t identifyTime)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::IdentifyCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.Identify(nullptr, nullptr, identifyTime);
}
CHIP_ERROR chip_ime_AppendCommand_Identify_IdentifyQuery(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                         chip::GroupId)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::IdentifyCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.IdentifyQuery(nullptr, nullptr);
}

CHIP_ERROR chip_ime_ReadAttribute_Identify_IdentifyTime(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                        chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::IdentifyCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeIdentifyTime(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_WriteAttribute_Identify_IdentifyTime(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                         chip::GroupId, uint16_t value)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::IdentifyCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.WriteAttributeIdentifyTime(gDefaultSuccessCallback.Cancel(), gDefaultFailureCallback.Cancel(), value);
}
CHIP_ERROR chip_ime_ReadAttribute_Identify_ClusterRevision(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                           chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::IdentifyCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

// End of Cluster Identify
// Cluster KeypadInput

CHIP_ERROR chip_ime_AppendCommand_KeypadInput_SendKey(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                      chip::GroupId, uint8_t keyCode)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::KeypadInputCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.SendKey(nullptr, nullptr, keyCode);
}

CHIP_ERROR chip_ime_ReadAttribute_KeypadInput_ClusterRevision(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                              chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::KeypadInputCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

// End of Cluster KeypadInput
// Cluster LevelControl

CHIP_ERROR chip_ime_AppendCommand_LevelControl_Move(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                    chip::GroupId, uint8_t moveMode, uint8_t rate, uint8_t optionMask,
                                                    uint8_t optionOverride)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::LevelControlCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.Move(nullptr, nullptr, moveMode, rate, optionMask, optionOverride);
}
CHIP_ERROR chip_ime_AppendCommand_LevelControl_MoveToLevel(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                           chip::GroupId, uint8_t level, uint16_t transitionTime,
                                                           uint8_t optionMask, uint8_t optionOverride)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::LevelControlCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.MoveToLevel(nullptr, nullptr, level, transitionTime, optionMask, optionOverride);
}
CHIP_ERROR chip_ime_AppendCommand_LevelControl_MoveToLevelWithOnOff(chip::Controller::Device * device,
                                                                    chip::EndpointId ZCLendpointId, chip::GroupId, uint8_t level,
                                                                    uint16_t transitionTime)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::LevelControlCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.MoveToLevelWithOnOff(nullptr, nullptr, level, transitionTime);
}
CHIP_ERROR chip_ime_AppendCommand_LevelControl_MoveWithOnOff(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                             chip::GroupId, uint8_t moveMode, uint8_t rate)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::LevelControlCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.MoveWithOnOff(nullptr, nullptr, moveMode, rate);
}
CHIP_ERROR chip_ime_AppendCommand_LevelControl_Step(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                    chip::GroupId, uint8_t stepMode, uint8_t stepSize, uint16_t transitionTime,
                                                    uint8_t optionMask, uint8_t optionOverride)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::LevelControlCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.Step(nullptr, nullptr, stepMode, stepSize, transitionTime, optionMask, optionOverride);
}
CHIP_ERROR chip_ime_AppendCommand_LevelControl_StepWithOnOff(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                             chip::GroupId, uint8_t stepMode, uint8_t stepSize,
                                                             uint16_t transitionTime)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::LevelControlCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.StepWithOnOff(nullptr, nullptr, stepMode, stepSize, transitionTime);
}
CHIP_ERROR chip_ime_AppendCommand_LevelControl_Stop(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                    chip::GroupId, uint8_t optionMask, uint8_t optionOverride)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::LevelControlCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.Stop(nullptr, nullptr, optionMask, optionOverride);
}
CHIP_ERROR chip_ime_AppendCommand_LevelControl_StopWithOnOff(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                             chip::GroupId)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::LevelControlCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.StopWithOnOff(nullptr, nullptr);
}

CHIP_ERROR chip_ime_ReadAttribute_LevelControl_CurrentLevel(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                            chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::LevelControlCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeCurrentLevel(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ConfigureAttribute_LevelControl_CurrentLevel(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                                 uint16_t minInterval, uint16_t maxInterval, uint8_t change)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::LevelControlCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ConfigureAttributeCurrentLevel(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval,
                                                  maxInterval, change);
}

CHIP_ERROR chip_ime_ReadAttribute_LevelControl_ClusterRevision(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                               chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::LevelControlCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

// End of Cluster LevelControl
// Cluster LowPower

CHIP_ERROR chip_ime_AppendCommand_LowPower_Sleep(chip::Controller::Device * device, chip::EndpointId ZCLendpointId, chip::GroupId)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::LowPowerCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.Sleep(nullptr, nullptr);
}

CHIP_ERROR chip_ime_ReadAttribute_LowPower_ClusterRevision(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                           chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::LowPowerCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

// End of Cluster LowPower
// Cluster MediaInput

CHIP_ERROR chip_ime_AppendCommand_MediaInput_HideInputStatus(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                             chip::GroupId)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::MediaInputCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.HideInputStatus(nullptr, nullptr);
}
CHIP_ERROR chip_ime_AppendCommand_MediaInput_RenameInput(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                         chip::GroupId, uint8_t index, const uint8_t * name, uint32_t name_Len)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::MediaInputCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.RenameInput(nullptr, nullptr, index, chip::ByteSpan(name, name_Len));
}
CHIP_ERROR chip_ime_AppendCommand_MediaInput_SelectInput(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                         chip::GroupId, uint8_t index)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::MediaInputCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.SelectInput(nullptr, nullptr, index);
}
CHIP_ERROR chip_ime_AppendCommand_MediaInput_ShowInputStatus(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                             chip::GroupId)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::MediaInputCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ShowInputStatus(nullptr, nullptr);
}

CHIP_ERROR chip_ime_ReadAttribute_MediaInput_MediaInputList(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                            chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::MediaInputCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeMediaInputList(gMediaInputMediaInputListListAttributeCallback.Cancel(),
                                               gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_MediaInput_CurrentMediaInput(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                               chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::MediaInputCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeCurrentMediaInput(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_MediaInput_ClusterRevision(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                             chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::MediaInputCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

// End of Cluster MediaInput
// Cluster MediaPlayback

CHIP_ERROR chip_ime_AppendCommand_MediaPlayback_MediaFastForward(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                                 chip::GroupId)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::MediaPlaybackCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.MediaFastForward(nullptr, nullptr);
}
CHIP_ERROR chip_ime_AppendCommand_MediaPlayback_MediaNext(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                          chip::GroupId)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::MediaPlaybackCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.MediaNext(nullptr, nullptr);
}
CHIP_ERROR chip_ime_AppendCommand_MediaPlayback_MediaPause(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                           chip::GroupId)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::MediaPlaybackCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.MediaPause(nullptr, nullptr);
}
CHIP_ERROR chip_ime_AppendCommand_MediaPlayback_MediaPlay(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                          chip::GroupId)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::MediaPlaybackCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.MediaPlay(nullptr, nullptr);
}
CHIP_ERROR chip_ime_AppendCommand_MediaPlayback_MediaPrevious(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                              chip::GroupId)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::MediaPlaybackCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.MediaPrevious(nullptr, nullptr);
}
CHIP_ERROR chip_ime_AppendCommand_MediaPlayback_MediaRewind(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                            chip::GroupId)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::MediaPlaybackCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.MediaRewind(nullptr, nullptr);
}
CHIP_ERROR chip_ime_AppendCommand_MediaPlayback_MediaSeek(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                          chip::GroupId, uint64_t position)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::MediaPlaybackCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.MediaSeek(nullptr, nullptr, position);
}
CHIP_ERROR chip_ime_AppendCommand_MediaPlayback_MediaSkipBackward(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                                  chip::GroupId, uint64_t deltaPositionMilliseconds)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::MediaPlaybackCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.MediaSkipBackward(nullptr, nullptr, deltaPositionMilliseconds);
}
CHIP_ERROR chip_ime_AppendCommand_MediaPlayback_MediaSkipForward(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                                 chip::GroupId, uint64_t deltaPositionMilliseconds)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::MediaPlaybackCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.MediaSkipForward(nullptr, nullptr, deltaPositionMilliseconds);
}
CHIP_ERROR chip_ime_AppendCommand_MediaPlayback_MediaStartOver(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                               chip::GroupId)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::MediaPlaybackCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.MediaStartOver(nullptr, nullptr);
}
CHIP_ERROR chip_ime_AppendCommand_MediaPlayback_MediaStop(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                          chip::GroupId)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::MediaPlaybackCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.MediaStop(nullptr, nullptr);
}

CHIP_ERROR chip_ime_ReadAttribute_MediaPlayback_ClusterRevision(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                                chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::MediaPlaybackCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

// End of Cluster MediaPlayback
// Cluster NetworkCommissioning

CHIP_ERROR chip_ime_AppendCommand_NetworkCommissioning_AddThreadNetwork(chip::Controller::Device * device,
                                                                        chip::EndpointId ZCLendpointId, chip::GroupId,
                                                                        const uint8_t * operationalDataset,
                                                                        uint32_t operationalDataset_Len, uint64_t breadcrumb,
                                                                        uint32_t timeoutMs)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::NetworkCommissioningCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.AddThreadNetwork(nullptr, nullptr, chip::ByteSpan(operationalDataset, operationalDataset_Len), breadcrumb,
                                    timeoutMs);
}
CHIP_ERROR chip_ime_AppendCommand_NetworkCommissioning_AddWiFiNetwork(chip::Controller::Device * device,
                                                                      chip::EndpointId ZCLendpointId, chip::GroupId,
                                                                      const uint8_t * ssid, uint32_t ssid_Len,
                                                                      const uint8_t * credentials, uint32_t credentials_Len,
                                                                      uint64_t breadcrumb, uint32_t timeoutMs)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::NetworkCommissioningCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.AddWiFiNetwork(nullptr, nullptr, chip::ByteSpan(ssid, ssid_Len), chip::ByteSpan(credentials, credentials_Len),
                                  breadcrumb, timeoutMs);
}
CHIP_ERROR chip_ime_AppendCommand_NetworkCommissioning_DisableNetwork(chip::Controller::Device * device,
                                                                      chip::EndpointId ZCLendpointId, chip::GroupId,
                                                                      const uint8_t * networkID, uint32_t networkID_Len,
                                                                      uint64_t breadcrumb, uint32_t timeoutMs)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::NetworkCommissioningCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.DisableNetwork(nullptr, nullptr, chip::ByteSpan(networkID, networkID_Len), breadcrumb, timeoutMs);
}
CHIP_ERROR chip_ime_AppendCommand_NetworkCommissioning_EnableNetwork(chip::Controller::Device * device,
                                                                     chip::EndpointId ZCLendpointId, chip::GroupId,
                                                                     const uint8_t * networkID, uint32_t networkID_Len,
                                                                     uint64_t breadcrumb, uint32_t timeoutMs)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::NetworkCommissioningCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.EnableNetwork(nullptr, nullptr, chip::ByteSpan(networkID, networkID_Len), breadcrumb, timeoutMs);
}
CHIP_ERROR chip_ime_AppendCommand_NetworkCommissioning_GetLastNetworkCommissioningResult(chip::Controller::Device * device,
                                                                                         chip::EndpointId ZCLendpointId,
                                                                                         chip::GroupId, uint32_t timeoutMs)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::NetworkCommissioningCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.GetLastNetworkCommissioningResult(nullptr, nullptr, timeoutMs);
}
CHIP_ERROR chip_ime_AppendCommand_NetworkCommissioning_RemoveNetwork(chip::Controller::Device * device,
                                                                     chip::EndpointId ZCLendpointId, chip::GroupId,
                                                                     const uint8_t * networkID, uint32_t networkID_Len,
                                                                     uint64_t breadcrumb, uint32_t timeoutMs)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::NetworkCommissioningCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.RemoveNetwork(nullptr, nullptr, chip::ByteSpan(networkID, networkID_Len), breadcrumb, timeoutMs);
}
CHIP_ERROR chip_ime_AppendCommand_NetworkCommissioning_ScanNetworks(chip::Controller::Device * device,
                                                                    chip::EndpointId ZCLendpointId, chip::GroupId,
                                                                    const uint8_t * ssid, uint32_t ssid_Len, uint64_t breadcrumb,
                                                                    uint32_t timeoutMs)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::NetworkCommissioningCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ScanNetworks(nullptr, nullptr, chip::ByteSpan(ssid, ssid_Len), breadcrumb, timeoutMs);
}
CHIP_ERROR chip_ime_AppendCommand_NetworkCommissioning_UpdateThreadNetwork(chip::Controller::Device * device,
                                                                           chip::EndpointId ZCLendpointId, chip::GroupId,
                                                                           const uint8_t * operationalDataset,
                                                                           uint32_t operationalDataset_Len, uint64_t breadcrumb,
                                                                           uint32_t timeoutMs)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::NetworkCommissioningCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.UpdateThreadNetwork(nullptr, nullptr, chip::ByteSpan(operationalDataset, operationalDataset_Len), breadcrumb,
                                       timeoutMs);
}
CHIP_ERROR chip_ime_AppendCommand_NetworkCommissioning_UpdateWiFiNetwork(chip::Controller::Device * device,
                                                                         chip::EndpointId ZCLendpointId, chip::GroupId,
                                                                         const uint8_t * ssid, uint32_t ssid_Len,
                                                                         const uint8_t * credentials, uint32_t credentials_Len,
                                                                         uint64_t breadcrumb, uint32_t timeoutMs)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::NetworkCommissioningCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.UpdateWiFiNetwork(nullptr, nullptr, chip::ByteSpan(ssid, ssid_Len), chip::ByteSpan(credentials, credentials_Len),
                                     breadcrumb, timeoutMs);
}

CHIP_ERROR chip_ime_ReadAttribute_NetworkCommissioning_ClusterRevision(chip::Controller::Device * device,
                                                                       chip::EndpointId ZCLendpointId,
                                                                       chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::NetworkCommissioningCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

// End of Cluster NetworkCommissioning
// Cluster OtaSoftwareUpdateProvider

CHIP_ERROR chip_ime_AppendCommand_OtaSoftwareUpdateProvider_ApplyUpdateRequest(chip::Controller::Device * device,
                                                                               chip::EndpointId ZCLendpointId, chip::GroupId,
                                                                               const uint8_t * updateToken,
                                                                               uint32_t updateToken_Len, uint32_t newVersion)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::OtaSoftwareUpdateProviderCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ApplyUpdateRequest(nullptr, nullptr, chip::ByteSpan(updateToken, updateToken_Len), newVersion);
}
CHIP_ERROR chip_ime_AppendCommand_OtaSoftwareUpdateProvider_NotifyUpdateApplied(chip::Controller::Device * device,
                                                                                chip::EndpointId ZCLendpointId, chip::GroupId,
                                                                                const uint8_t * updateToken,
                                                                                uint32_t updateToken_Len, uint32_t currentVersion)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::OtaSoftwareUpdateProviderCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.NotifyUpdateApplied(nullptr, nullptr, chip::ByteSpan(updateToken, updateToken_Len), currentVersion);
}
CHIP_ERROR chip_ime_AppendCommand_OtaSoftwareUpdateProvider_QueryImage(
    chip::Controller::Device * device, chip::EndpointId ZCLendpointId, chip::GroupId, uint16_t vendorId, uint16_t productId,
    uint16_t imageType, uint16_t hardwareVersion, uint32_t currentVersion, uint8_t protocolsSupported, const uint8_t * location,
    uint32_t location_Len, uint8_t requestorCanConsent, const uint8_t * metadataForProvider, uint32_t metadataForProvider_Len)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::OtaSoftwareUpdateProviderCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.QueryImage(nullptr, nullptr, vendorId, productId, imageType, hardwareVersion, currentVersion, protocolsSupported,
                              chip::ByteSpan(location, location_Len), requestorCanConsent,
                              chip::ByteSpan(metadataForProvider, metadataForProvider_Len));
}

CHIP_ERROR chip_ime_ReadAttribute_OtaSoftwareUpdateProvider_ClusterRevision(chip::Controller::Device * device,
                                                                            chip::EndpointId ZCLendpointId,
                                                                            chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::OtaSoftwareUpdateProviderCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

// End of Cluster OtaSoftwareUpdateProvider
// Cluster OccupancySensing

CHIP_ERROR chip_ime_ReadAttribute_OccupancySensing_Occupancy(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                             chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::OccupancySensingCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeOccupancy(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ConfigureAttribute_OccupancySensing_Occupancy(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                                  uint16_t minInterval, uint16_t maxInterval)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::OccupancySensingCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ConfigureAttributeOccupancy(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval,
                                               maxInterval);
}

CHIP_ERROR chip_ime_ReadAttribute_OccupancySensing_OccupancySensorType(chip::Controller::Device * device,
                                                                       chip::EndpointId ZCLendpointId,
                                                                       chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::OccupancySensingCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeOccupancySensorType(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_OccupancySensing_OccupancySensorTypeBitmap(chip::Controller::Device * device,
                                                                             chip::EndpointId ZCLendpointId,
                                                                             chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::OccupancySensingCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeOccupancySensorTypeBitmap(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_OccupancySensing_ClusterRevision(chip::Controller::Device * device,
                                                                   chip::EndpointId ZCLendpointId, chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::OccupancySensingCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

// End of Cluster OccupancySensing
// Cluster OnOff

CHIP_ERROR chip_ime_AppendCommand_OnOff_Off(chip::Controller::Device * device, chip::EndpointId ZCLendpointId, chip::GroupId)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::OnOffCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.Off(nullptr, nullptr);
}
CHIP_ERROR chip_ime_AppendCommand_OnOff_On(chip::Controller::Device * device, chip::EndpointId ZCLendpointId, chip::GroupId)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::OnOffCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.On(nullptr, nullptr);
}
CHIP_ERROR chip_ime_AppendCommand_OnOff_Toggle(chip::Controller::Device * device, chip::EndpointId ZCLendpointId, chip::GroupId)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::OnOffCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.Toggle(nullptr, nullptr);
}

CHIP_ERROR chip_ime_ReadAttribute_OnOff_OnOff(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                              chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::OnOffCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeOnOff(gBooleanAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ConfigureAttribute_OnOff_OnOff(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                   uint16_t minInterval, uint16_t maxInterval)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::OnOffCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ConfigureAttributeOnOff(gBooleanAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval,
                                           maxInterval);
}

CHIP_ERROR chip_ime_ReadAttribute_OnOff_GlobalSceneControl(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                           chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::OnOffCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeGlobalSceneControl(gBooleanAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_OnOff_OnTime(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                               chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::OnOffCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeOnTime(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_WriteAttribute_OnOff_OnTime(chip::Controller::Device * device, chip::EndpointId ZCLendpointId, chip::GroupId,
                                                uint16_t value)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::OnOffCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.WriteAttributeOnTime(gDefaultSuccessCallback.Cancel(), gDefaultFailureCallback.Cancel(), value);
}
CHIP_ERROR chip_ime_ReadAttribute_OnOff_OffWaitTime(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                    chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::OnOffCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeOffWaitTime(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_WriteAttribute_OnOff_OffWaitTime(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                     chip::GroupId, uint16_t value)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::OnOffCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.WriteAttributeOffWaitTime(gDefaultSuccessCallback.Cancel(), gDefaultFailureCallback.Cancel(), value);
}
CHIP_ERROR chip_ime_ReadAttribute_OnOff_StartUpOnOff(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                     chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::OnOffCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeStartUpOnOff(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_WriteAttribute_OnOff_StartUpOnOff(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                      chip::GroupId, uint8_t value)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::OnOffCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.WriteAttributeStartUpOnOff(gDefaultSuccessCallback.Cancel(), gDefaultFailureCallback.Cancel(), value);
}
CHIP_ERROR chip_ime_ReadAttribute_OnOff_FeatureMap(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                   chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::OnOffCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeFeatureMap(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_OnOff_ClusterRevision(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                        chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::OnOffCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

// End of Cluster OnOff
// Cluster OperationalCredentials

CHIP_ERROR chip_ime_AppendCommand_OperationalCredentials_AddOpCert(chip::Controller::Device * device,
                                                                   chip::EndpointId ZCLendpointId, chip::GroupId,
                                                                   const uint8_t * nOCArray, uint32_t nOCArray_Len,
                                                                   const uint8_t * iPKValue, uint32_t iPKValue_Len,
                                                                   chip::NodeId caseAdminNode, uint16_t adminVendorId)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::OperationalCredentialsCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.AddOpCert(nullptr, nullptr, chip::ByteSpan(nOCArray, nOCArray_Len), chip::ByteSpan(iPKValue, iPKValue_Len),
                             caseAdminNode, adminVendorId);
}
CHIP_ERROR chip_ime_AppendCommand_OperationalCredentials_AddTrustedRootCertificate(chip::Controller::Device * device,
                                                                                   chip::EndpointId ZCLendpointId, chip::GroupId,
                                                                                   const uint8_t * rootCertificate,
                                                                                   uint32_t rootCertificate_Len)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::OperationalCredentialsCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.AddTrustedRootCertificate(nullptr, nullptr, chip::ByteSpan(rootCertificate, rootCertificate_Len));
}
CHIP_ERROR chip_ime_AppendCommand_OperationalCredentials_OpCSRRequest(chip::Controller::Device * device,
                                                                      chip::EndpointId ZCLendpointId, chip::GroupId,
                                                                      const uint8_t * cSRNonce, uint32_t cSRNonce_Len)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::OperationalCredentialsCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.OpCSRRequest(nullptr, nullptr, chip::ByteSpan(cSRNonce, cSRNonce_Len));
}
CHIP_ERROR chip_ime_AppendCommand_OperationalCredentials_RemoveAllFabrics(chip::Controller::Device * device,
                                                                          chip::EndpointId ZCLendpointId, chip::GroupId)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::OperationalCredentialsCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.RemoveAllFabrics(nullptr, nullptr);
}
CHIP_ERROR chip_ime_AppendCommand_OperationalCredentials_RemoveFabric(chip::Controller::Device * device,
                                                                      chip::EndpointId ZCLendpointId, chip::GroupId,
                                                                      chip::FabricId fabricId, chip::NodeId nodeId,
                                                                      uint16_t vendorId)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::OperationalCredentialsCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.RemoveFabric(nullptr, nullptr, fabricId, nodeId, vendorId);
}
CHIP_ERROR chip_ime_AppendCommand_OperationalCredentials_RemoveTrustedRootCertificate(chip::Controller::Device * device,
                                                                                      chip::EndpointId ZCLendpointId, chip::GroupId,
                                                                                      const uint8_t * trustedRootIdentifier,
                                                                                      uint32_t trustedRootIdentifier_Len)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::OperationalCredentialsCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.RemoveTrustedRootCertificate(nullptr, nullptr, chip::ByteSpan(trustedRootIdentifier, trustedRootIdentifier_Len));
}
CHIP_ERROR chip_ime_AppendCommand_OperationalCredentials_SetFabric(chip::Controller::Device * device,
                                                                   chip::EndpointId ZCLendpointId, chip::GroupId, uint16_t vendorId)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::OperationalCredentialsCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.SetFabric(nullptr, nullptr, vendorId);
}
CHIP_ERROR chip_ime_AppendCommand_OperationalCredentials_UpdateFabricLabel(chip::Controller::Device * device,
                                                                           chip::EndpointId ZCLendpointId, chip::GroupId,
                                                                           const uint8_t * label, uint32_t label_Len)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::OperationalCredentialsCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.UpdateFabricLabel(nullptr, nullptr, chip::ByteSpan(label, label_Len));
}

CHIP_ERROR chip_ime_ReadAttribute_OperationalCredentials_FabricsList(chip::Controller::Device * device,
                                                                     chip::EndpointId ZCLendpointId, chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::OperationalCredentialsCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeFabricsList(gOperationalCredentialsFabricsListListAttributeCallback.Cancel(),
                                            gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_OperationalCredentials_ClusterRevision(chip::Controller::Device * device,
                                                                         chip::EndpointId ZCLendpointId,
                                                                         chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::OperationalCredentialsCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

// End of Cluster OperationalCredentials
// Cluster PressureMeasurement

CHIP_ERROR chip_ime_ReadAttribute_PressureMeasurement_MeasuredValue(chip::Controller::Device * device,
                                                                    chip::EndpointId ZCLendpointId, chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::PressureMeasurementCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeMeasuredValue(gInt16sAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ConfigureAttribute_PressureMeasurement_MeasuredValue(chip::Controller::Device * device,
                                                                         chip::EndpointId ZCLendpointId, uint16_t minInterval,
                                                                         uint16_t maxInterval, int16_t change)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::PressureMeasurementCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ConfigureAttributeMeasuredValue(gInt16sAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval,
                                                   maxInterval, change);
}

CHIP_ERROR chip_ime_ReadAttribute_PressureMeasurement_MinMeasuredValue(chip::Controller::Device * device,
                                                                       chip::EndpointId ZCLendpointId,
                                                                       chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::PressureMeasurementCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeMinMeasuredValue(gInt16sAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_PressureMeasurement_MaxMeasuredValue(chip::Controller::Device * device,
                                                                       chip::EndpointId ZCLendpointId,
                                                                       chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::PressureMeasurementCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeMaxMeasuredValue(gInt16sAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_PressureMeasurement_ClusterRevision(chip::Controller::Device * device,
                                                                      chip::EndpointId ZCLendpointId,
                                                                      chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::PressureMeasurementCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

// End of Cluster PressureMeasurement
// Cluster PumpConfigurationAndControl

CHIP_ERROR chip_ime_ReadAttribute_PumpConfigurationAndControl_MaxPressure(chip::Controller::Device * device,
                                                                          chip::EndpointId ZCLendpointId,
                                                                          chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::PumpConfigurationAndControlCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeMaxPressure(gInt16sAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_PumpConfigurationAndControl_MaxSpeed(chip::Controller::Device * device,
                                                                       chip::EndpointId ZCLendpointId,
                                                                       chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::PumpConfigurationAndControlCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeMaxSpeed(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_PumpConfigurationAndControl_MaxFlow(chip::Controller::Device * device,
                                                                      chip::EndpointId ZCLendpointId,
                                                                      chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::PumpConfigurationAndControlCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeMaxFlow(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_PumpConfigurationAndControl_EffectiveOperationMode(chip::Controller::Device * device,
                                                                                     chip::EndpointId ZCLendpointId,
                                                                                     chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::PumpConfigurationAndControlCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeEffectiveOperationMode(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_PumpConfigurationAndControl_EffectiveControlMode(chip::Controller::Device * device,
                                                                                   chip::EndpointId ZCLendpointId,
                                                                                   chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::PumpConfigurationAndControlCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeEffectiveControlMode(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_PumpConfigurationAndControl_Capacity(chip::Controller::Device * device,
                                                                       chip::EndpointId ZCLendpointId,
                                                                       chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::PumpConfigurationAndControlCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeCapacity(gInt16sAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ConfigureAttribute_PumpConfigurationAndControl_Capacity(chip::Controller::Device * device,
                                                                            chip::EndpointId ZCLendpointId, uint16_t minInterval,
                                                                            uint16_t maxInterval, int16_t change)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::PumpConfigurationAndControlCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ConfigureAttributeCapacity(gInt16sAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval,
                                              maxInterval, change);
}

CHIP_ERROR chip_ime_ReadAttribute_PumpConfigurationAndControl_OperationMode(chip::Controller::Device * device,
                                                                            chip::EndpointId ZCLendpointId,
                                                                            chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::PumpConfigurationAndControlCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeOperationMode(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_WriteAttribute_PumpConfigurationAndControl_OperationMode(chip::Controller::Device * device,
                                                                             chip::EndpointId ZCLendpointId, chip::GroupId,
                                                                             uint8_t value)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::PumpConfigurationAndControlCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.WriteAttributeOperationMode(gDefaultSuccessCallback.Cancel(), gDefaultFailureCallback.Cancel(), value);
}
CHIP_ERROR chip_ime_ReadAttribute_PumpConfigurationAndControl_ClusterRevision(chip::Controller::Device * device,
                                                                              chip::EndpointId ZCLendpointId,
                                                                              chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::PumpConfigurationAndControlCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

// End of Cluster PumpConfigurationAndControl
// Cluster RelativeHumidityMeasurement

CHIP_ERROR chip_ime_ReadAttribute_RelativeHumidityMeasurement_MeasuredValue(chip::Controller::Device * device,
                                                                            chip::EndpointId ZCLendpointId,
                                                                            chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::RelativeHumidityMeasurementCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeMeasuredValue(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ConfigureAttribute_RelativeHumidityMeasurement_MeasuredValue(chip::Controller::Device * device,
                                                                                 chip::EndpointId ZCLendpointId,
                                                                                 uint16_t minInterval, uint16_t maxInterval,
                                                                                 uint16_t change)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::RelativeHumidityMeasurementCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ConfigureAttributeMeasuredValue(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval,
                                                   maxInterval, change);
}

CHIP_ERROR chip_ime_ReadAttribute_RelativeHumidityMeasurement_MinMeasuredValue(chip::Controller::Device * device,
                                                                               chip::EndpointId ZCLendpointId,
                                                                               chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::RelativeHumidityMeasurementCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeMinMeasuredValue(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_RelativeHumidityMeasurement_MaxMeasuredValue(chip::Controller::Device * device,
                                                                               chip::EndpointId ZCLendpointId,
                                                                               chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::RelativeHumidityMeasurementCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeMaxMeasuredValue(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_RelativeHumidityMeasurement_ClusterRevision(chip::Controller::Device * device,
                                                                              chip::EndpointId ZCLendpointId,
                                                                              chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::RelativeHumidityMeasurementCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

// End of Cluster RelativeHumidityMeasurement
// Cluster Scenes

CHIP_ERROR chip_ime_AppendCommand_Scenes_AddScene(chip::Controller::Device * device, chip::EndpointId ZCLendpointId, chip::GroupId,
                                                  uint16_t groupId, uint8_t sceneId, uint16_t transitionTime,
                                                  const uint8_t * sceneName, uint32_t sceneName_Len, chip::ClusterId clusterId,
                                                  uint8_t length, uint8_t value)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ScenesCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.AddScene(nullptr, nullptr, groupId, sceneId, transitionTime, chip::ByteSpan(sceneName, sceneName_Len), clusterId,
                            length, value);
}
CHIP_ERROR chip_ime_AppendCommand_Scenes_GetSceneMembership(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                            chip::GroupId, uint16_t groupId)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ScenesCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.GetSceneMembership(nullptr, nullptr, groupId);
}
CHIP_ERROR chip_ime_AppendCommand_Scenes_RecallScene(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                     chip::GroupId, uint16_t groupId, uint8_t sceneId, uint16_t transitionTime)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ScenesCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.RecallScene(nullptr, nullptr, groupId, sceneId, transitionTime);
}
CHIP_ERROR chip_ime_AppendCommand_Scenes_RemoveAllScenes(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                         chip::GroupId, uint16_t groupId)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ScenesCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.RemoveAllScenes(nullptr, nullptr, groupId);
}
CHIP_ERROR chip_ime_AppendCommand_Scenes_RemoveScene(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                     chip::GroupId, uint16_t groupId, uint8_t sceneId)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ScenesCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.RemoveScene(nullptr, nullptr, groupId, sceneId);
}
CHIP_ERROR chip_ime_AppendCommand_Scenes_StoreScene(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                    chip::GroupId, uint16_t groupId, uint8_t sceneId)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ScenesCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.StoreScene(nullptr, nullptr, groupId, sceneId);
}
CHIP_ERROR chip_ime_AppendCommand_Scenes_ViewScene(chip::Controller::Device * device, chip::EndpointId ZCLendpointId, chip::GroupId,
                                                   uint16_t groupId, uint8_t sceneId)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ScenesCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ViewScene(nullptr, nullptr, groupId, sceneId);
}

CHIP_ERROR chip_ime_ReadAttribute_Scenes_SceneCount(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                    chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ScenesCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeSceneCount(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_Scenes_CurrentScene(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                      chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ScenesCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeCurrentScene(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_Scenes_CurrentGroup(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                      chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ScenesCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeCurrentGroup(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_Scenes_SceneValid(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                    chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ScenesCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeSceneValid(gBooleanAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_Scenes_NameSupport(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                     chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ScenesCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeNameSupport(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_Scenes_ClusterRevision(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                         chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ScenesCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

// End of Cluster Scenes
// Cluster SoftwareDiagnostics

CHIP_ERROR chip_ime_AppendCommand_SoftwareDiagnostics_ResetWatermarks(chip::Controller::Device * device,
                                                                      chip::EndpointId ZCLendpointId, chip::GroupId)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::SoftwareDiagnosticsCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ResetWatermarks(nullptr, nullptr);
}

CHIP_ERROR chip_ime_ReadAttribute_SoftwareDiagnostics_CurrentHeapHighWatermark(chip::Controller::Device * device,
                                                                               chip::EndpointId ZCLendpointId,
                                                                               chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::SoftwareDiagnosticsCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeCurrentHeapHighWatermark(gInt64uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_SoftwareDiagnostics_ClusterRevision(chip::Controller::Device * device,
                                                                      chip::EndpointId ZCLendpointId,
                                                                      chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::SoftwareDiagnosticsCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

// End of Cluster SoftwareDiagnostics
// Cluster Switch

CHIP_ERROR chip_ime_ReadAttribute_Switch_NumberOfPositions(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                           chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::SwitchCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeNumberOfPositions(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_Switch_CurrentPosition(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                         chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::SwitchCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeCurrentPosition(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ConfigureAttribute_Switch_CurrentPosition(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                              uint16_t minInterval, uint16_t maxInterval, uint8_t change)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::SwitchCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ConfigureAttributeCurrentPosition(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(),
                                                     minInterval, maxInterval, change);
}

CHIP_ERROR chip_ime_ReadAttribute_Switch_ClusterRevision(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                         chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::SwitchCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

// End of Cluster Switch
// Cluster TvChannel

CHIP_ERROR chip_ime_AppendCommand_TvChannel_ChangeChannel(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                          chip::GroupId, const uint8_t * match, uint32_t match_Len)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::TvChannelCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ChangeChannel(nullptr, nullptr, chip::ByteSpan(match, match_Len));
}
CHIP_ERROR chip_ime_AppendCommand_TvChannel_ChangeChannelByNumber(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                                  chip::GroupId, uint16_t majorNumber, uint16_t minorNumber)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::TvChannelCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ChangeChannelByNumber(nullptr, nullptr, majorNumber, minorNumber);
}
CHIP_ERROR chip_ime_AppendCommand_TvChannel_SkipChannel(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                        chip::GroupId, uint16_t count)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::TvChannelCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.SkipChannel(nullptr, nullptr, count);
}

CHIP_ERROR chip_ime_ReadAttribute_TvChannel_TvChannelList(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                          chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::TvChannelCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeTvChannelList(gTvChannelTvChannelListListAttributeCallback.Cancel(),
                                              gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_TvChannel_TvChannelLineup(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                            chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::TvChannelCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeTvChannelLineup(gStringAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_TvChannel_CurrentTvChannel(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                             chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::TvChannelCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeCurrentTvChannel(gStringAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_TvChannel_ClusterRevision(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                            chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::TvChannelCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

// End of Cluster TvChannel
// Cluster TargetNavigator

CHIP_ERROR chip_ime_AppendCommand_TargetNavigator_NavigateTarget(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                                 chip::GroupId, uint8_t target, const uint8_t * data,
                                                                 uint32_t data_Len)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::TargetNavigatorCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.NavigateTarget(nullptr, nullptr, target, chip::ByteSpan(data, data_Len));
}

CHIP_ERROR chip_ime_ReadAttribute_TargetNavigator_TargetNavigatorList(chip::Controller::Device * device,
                                                                      chip::EndpointId ZCLendpointId,
                                                                      chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::TargetNavigatorCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeTargetNavigatorList(gTargetNavigatorTargetNavigatorListListAttributeCallback.Cancel(),
                                                    gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_TargetNavigator_ClusterRevision(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                                  chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::TargetNavigatorCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

// End of Cluster TargetNavigator
// Cluster TemperatureMeasurement

CHIP_ERROR chip_ime_ReadAttribute_TemperatureMeasurement_MeasuredValue(chip::Controller::Device * device,
                                                                       chip::EndpointId ZCLendpointId,
                                                                       chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::TemperatureMeasurementCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeMeasuredValue(gInt16sAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ConfigureAttribute_TemperatureMeasurement_MeasuredValue(chip::Controller::Device * device,
                                                                            chip::EndpointId ZCLendpointId, uint16_t minInterval,
                                                                            uint16_t maxInterval, int16_t change)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::TemperatureMeasurementCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ConfigureAttributeMeasuredValue(gInt16sAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval,
                                                   maxInterval, change);
}

CHIP_ERROR chip_ime_ReadAttribute_TemperatureMeasurement_MinMeasuredValue(chip::Controller::Device * device,
                                                                          chip::EndpointId ZCLendpointId,
                                                                          chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::TemperatureMeasurementCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeMinMeasuredValue(gInt16sAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_TemperatureMeasurement_MaxMeasuredValue(chip::Controller::Device * device,
                                                                          chip::EndpointId ZCLendpointId,
                                                                          chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::TemperatureMeasurementCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeMaxMeasuredValue(gInt16sAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_TemperatureMeasurement_ClusterRevision(chip::Controller::Device * device,
                                                                         chip::EndpointId ZCLendpointId,
                                                                         chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::TemperatureMeasurementCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

// End of Cluster TemperatureMeasurement
// Cluster TestCluster

CHIP_ERROR chip_ime_AppendCommand_TestCluster_Test(chip::Controller::Device * device, chip::EndpointId ZCLendpointId, chip::GroupId)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::TestClusterCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.Test(nullptr, nullptr);
}
CHIP_ERROR chip_ime_AppendCommand_TestCluster_TestNotHandled(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                             chip::GroupId)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::TestClusterCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.TestNotHandled(nullptr, nullptr);
}
CHIP_ERROR chip_ime_AppendCommand_TestCluster_TestSpecific(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                           chip::GroupId)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::TestClusterCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.TestSpecific(nullptr, nullptr);
}
CHIP_ERROR chip_ime_AppendCommand_TestCluster_TestUnknownCommand(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                                 chip::GroupId)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::TestClusterCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.TestUnknownCommand(nullptr, nullptr);
}

CHIP_ERROR chip_ime_ReadAttribute_TestCluster_Boolean(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                      chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::TestClusterCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeBoolean(gBooleanAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_WriteAttribute_TestCluster_Boolean(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                       chip::GroupId, uint8_t value)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::TestClusterCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.WriteAttributeBoolean(gDefaultSuccessCallback.Cancel(), gDefaultFailureCallback.Cancel(), value);
}
CHIP_ERROR chip_ime_ReadAttribute_TestCluster_Bitmap8(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                      chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::TestClusterCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeBitmap8(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_WriteAttribute_TestCluster_Bitmap8(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                       chip::GroupId, uint8_t value)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::TestClusterCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.WriteAttributeBitmap8(gDefaultSuccessCallback.Cancel(), gDefaultFailureCallback.Cancel(), value);
}
CHIP_ERROR chip_ime_ReadAttribute_TestCluster_Bitmap16(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                       chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::TestClusterCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeBitmap16(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_WriteAttribute_TestCluster_Bitmap16(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                        chip::GroupId, uint16_t value)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::TestClusterCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.WriteAttributeBitmap16(gDefaultSuccessCallback.Cancel(), gDefaultFailureCallback.Cancel(), value);
}
CHIP_ERROR chip_ime_ReadAttribute_TestCluster_Bitmap32(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                       chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::TestClusterCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeBitmap32(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_WriteAttribute_TestCluster_Bitmap32(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                        chip::GroupId, uint32_t value)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::TestClusterCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.WriteAttributeBitmap32(gDefaultSuccessCallback.Cancel(), gDefaultFailureCallback.Cancel(), value);
}
CHIP_ERROR chip_ime_ReadAttribute_TestCluster_Bitmap64(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                       chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::TestClusterCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeBitmap64(gInt64uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_WriteAttribute_TestCluster_Bitmap64(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                        chip::GroupId, uint64_t value)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::TestClusterCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.WriteAttributeBitmap64(gDefaultSuccessCallback.Cancel(), gDefaultFailureCallback.Cancel(), value);
}
CHIP_ERROR chip_ime_ReadAttribute_TestCluster_Int8u(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                    chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::TestClusterCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeInt8u(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_WriteAttribute_TestCluster_Int8u(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                     chip::GroupId, uint8_t value)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::TestClusterCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.WriteAttributeInt8u(gDefaultSuccessCallback.Cancel(), gDefaultFailureCallback.Cancel(), value);
}
CHIP_ERROR chip_ime_ReadAttribute_TestCluster_Int16u(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                     chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::TestClusterCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeInt16u(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_WriteAttribute_TestCluster_Int16u(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                      chip::GroupId, uint16_t value)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::TestClusterCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.WriteAttributeInt16u(gDefaultSuccessCallback.Cancel(), gDefaultFailureCallback.Cancel(), value);
}
CHIP_ERROR chip_ime_ReadAttribute_TestCluster_Int32u(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                     chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::TestClusterCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeInt32u(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_WriteAttribute_TestCluster_Int32u(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                      chip::GroupId, uint32_t value)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::TestClusterCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.WriteAttributeInt32u(gDefaultSuccessCallback.Cancel(), gDefaultFailureCallback.Cancel(), value);
}
CHIP_ERROR chip_ime_ReadAttribute_TestCluster_Int64u(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                     chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::TestClusterCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeInt64u(gInt64uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_WriteAttribute_TestCluster_Int64u(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                      chip::GroupId, uint64_t value)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::TestClusterCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.WriteAttributeInt64u(gDefaultSuccessCallback.Cancel(), gDefaultFailureCallback.Cancel(), value);
}
CHIP_ERROR chip_ime_ReadAttribute_TestCluster_Int8s(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                    chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::TestClusterCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeInt8s(gInt8sAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_WriteAttribute_TestCluster_Int8s(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                     chip::GroupId, int8_t value)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::TestClusterCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.WriteAttributeInt8s(gDefaultSuccessCallback.Cancel(), gDefaultFailureCallback.Cancel(), value);
}
CHIP_ERROR chip_ime_ReadAttribute_TestCluster_Int16s(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                     chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::TestClusterCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeInt16s(gInt16sAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_WriteAttribute_TestCluster_Int16s(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                      chip::GroupId, int16_t value)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::TestClusterCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.WriteAttributeInt16s(gDefaultSuccessCallback.Cancel(), gDefaultFailureCallback.Cancel(), value);
}
CHIP_ERROR chip_ime_ReadAttribute_TestCluster_Int32s(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                     chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::TestClusterCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeInt32s(gInt32sAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_WriteAttribute_TestCluster_Int32s(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                      chip::GroupId, int32_t value)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::TestClusterCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.WriteAttributeInt32s(gDefaultSuccessCallback.Cancel(), gDefaultFailureCallback.Cancel(), value);
}
CHIP_ERROR chip_ime_ReadAttribute_TestCluster_Int64s(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                     chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::TestClusterCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeInt64s(gInt64sAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_WriteAttribute_TestCluster_Int64s(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                      chip::GroupId, int64_t value)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::TestClusterCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.WriteAttributeInt64s(gDefaultSuccessCallback.Cancel(), gDefaultFailureCallback.Cancel(), value);
}
CHIP_ERROR chip_ime_ReadAttribute_TestCluster_Enum8(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                    chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::TestClusterCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeEnum8(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_WriteAttribute_TestCluster_Enum8(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                     chip::GroupId, uint8_t value)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::TestClusterCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.WriteAttributeEnum8(gDefaultSuccessCallback.Cancel(), gDefaultFailureCallback.Cancel(), value);
}
CHIP_ERROR chip_ime_ReadAttribute_TestCluster_Enum16(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                     chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::TestClusterCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeEnum16(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_WriteAttribute_TestCluster_Enum16(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                      chip::GroupId, uint16_t value)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::TestClusterCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.WriteAttributeEnum16(gDefaultSuccessCallback.Cancel(), gDefaultFailureCallback.Cancel(), value);
}
CHIP_ERROR chip_ime_ReadAttribute_TestCluster_OctetString(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                          chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::TestClusterCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeOctetString(gStringAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_WriteAttribute_TestCluster_OctetString(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                           chip::GroupId, uint8_t * value, size_t len)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::TestClusterCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.WriteAttributeOctetString(gDefaultSuccessCallback.Cancel(), gDefaultFailureCallback.Cancel(),
                                             chip::ByteSpan(value, len));
}
CHIP_ERROR chip_ime_ReadAttribute_TestCluster_ListInt8u(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                        chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::TestClusterCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeListInt8u(gTestClusterListInt8uListAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_TestCluster_ListOctetString(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                              chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::TestClusterCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeListOctetString(gTestClusterListOctetStringListAttributeCallback.Cancel(),
                                                gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_TestCluster_ListStructOctetString(chip::Controller::Device * device,
                                                                    chip::EndpointId ZCLendpointId, chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::TestClusterCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeListStructOctetString(gTestClusterListStructOctetStringListAttributeCallback.Cancel(),
                                                      gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_TestCluster_LongOctetString(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                              chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::TestClusterCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeLongOctetString(gStringAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_WriteAttribute_TestCluster_LongOctetString(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                               chip::GroupId, uint8_t * value, size_t len)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::TestClusterCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.WriteAttributeLongOctetString(gDefaultSuccessCallback.Cancel(), gDefaultFailureCallback.Cancel(),
                                                 chip::ByteSpan(value, len));
}
CHIP_ERROR chip_ime_ReadAttribute_TestCluster_Unsupported(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                          chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::TestClusterCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeUnsupported(gBooleanAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_WriteAttribute_TestCluster_Unsupported(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                           chip::GroupId, uint8_t value)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::TestClusterCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.WriteAttributeUnsupported(gDefaultSuccessCallback.Cancel(), gDefaultFailureCallback.Cancel(), value);
}
CHIP_ERROR chip_ime_ReadAttribute_TestCluster_ClusterRevision(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                              chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::TestClusterCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

// End of Cluster TestCluster
// Cluster Thermostat

CHIP_ERROR chip_ime_AppendCommand_Thermostat_ClearWeeklySchedule(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                                 chip::GroupId)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ThermostatCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ClearWeeklySchedule(nullptr, nullptr);
}
CHIP_ERROR chip_ime_AppendCommand_Thermostat_GetRelayStatusLog(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                               chip::GroupId)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ThermostatCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.GetRelayStatusLog(nullptr, nullptr);
}
CHIP_ERROR chip_ime_AppendCommand_Thermostat_GetWeeklySchedule(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                               chip::GroupId, uint8_t daysToReturn, uint8_t modeToReturn)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ThermostatCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.GetWeeklySchedule(nullptr, nullptr, daysToReturn, modeToReturn);
}
CHIP_ERROR chip_ime_AppendCommand_Thermostat_SetWeeklySchedule(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                               chip::GroupId, uint8_t numberOfTransitionsForSequence,
                                                               uint8_t dayOfWeekForSequence, uint8_t modeForSequence,
                                                               uint8_t payload)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ThermostatCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.SetWeeklySchedule(nullptr, nullptr, numberOfTransitionsForSequence, dayOfWeekForSequence, modeForSequence,
                                     payload);
}
CHIP_ERROR chip_ime_AppendCommand_Thermostat_SetpointRaiseLower(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                                chip::GroupId, uint8_t mode, int8_t amount)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ThermostatCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.SetpointRaiseLower(nullptr, nullptr, mode, amount);
}

CHIP_ERROR chip_ime_ReadAttribute_Thermostat_LocalTemperature(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                              chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ThermostatCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeLocalTemperature(gInt16sAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ConfigureAttribute_Thermostat_LocalTemperature(chip::Controller::Device * device,
                                                                   chip::EndpointId ZCLendpointId, uint16_t minInterval,
                                                                   uint16_t maxInterval, int16_t change)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ThermostatCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ConfigureAttributeLocalTemperature(gInt16sAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(),
                                                      minInterval, maxInterval, change);
}

CHIP_ERROR chip_ime_ReadAttribute_Thermostat_OccupiedCoolingSetpoint(chip::Controller::Device * device,
                                                                     chip::EndpointId ZCLendpointId, chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ThermostatCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeOccupiedCoolingSetpoint(gInt16sAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_WriteAttribute_Thermostat_OccupiedCoolingSetpoint(chip::Controller::Device * device,
                                                                      chip::EndpointId ZCLendpointId, chip::GroupId, int16_t value)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ThermostatCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.WriteAttributeOccupiedCoolingSetpoint(gDefaultSuccessCallback.Cancel(), gDefaultFailureCallback.Cancel(), value);
}
CHIP_ERROR chip_ime_ReadAttribute_Thermostat_OccupiedHeatingSetpoint(chip::Controller::Device * device,
                                                                     chip::EndpointId ZCLendpointId, chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ThermostatCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeOccupiedHeatingSetpoint(gInt16sAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_WriteAttribute_Thermostat_OccupiedHeatingSetpoint(chip::Controller::Device * device,
                                                                      chip::EndpointId ZCLendpointId, chip::GroupId, int16_t value)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ThermostatCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.WriteAttributeOccupiedHeatingSetpoint(gDefaultSuccessCallback.Cancel(), gDefaultFailureCallback.Cancel(), value);
}
CHIP_ERROR chip_ime_ReadAttribute_Thermostat_ControlSequenceOfOperation(chip::Controller::Device * device,
                                                                        chip::EndpointId ZCLendpointId,
                                                                        chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ThermostatCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeControlSequenceOfOperation(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_WriteAttribute_Thermostat_ControlSequenceOfOperation(chip::Controller::Device * device,
                                                                         chip::EndpointId ZCLendpointId, chip::GroupId,
                                                                         uint8_t value)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ThermostatCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.WriteAttributeControlSequenceOfOperation(gDefaultSuccessCallback.Cancel(), gDefaultFailureCallback.Cancel(),
                                                            value);
}
CHIP_ERROR chip_ime_ReadAttribute_Thermostat_SystemMode(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                        chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ThermostatCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeSystemMode(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_WriteAttribute_Thermostat_SystemMode(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                         chip::GroupId, uint8_t value)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ThermostatCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.WriteAttributeSystemMode(gDefaultSuccessCallback.Cancel(), gDefaultFailureCallback.Cancel(), value);
}
CHIP_ERROR chip_ime_ReadAttribute_Thermostat_ClusterRevision(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                             chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ThermostatCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

// End of Cluster Thermostat
// Cluster ThreadNetworkDiagnostics

CHIP_ERROR chip_ime_AppendCommand_ThreadNetworkDiagnostics_ResetCounts(chip::Controller::Device * device,
                                                                       chip::EndpointId ZCLendpointId, chip::GroupId)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ThreadNetworkDiagnosticsCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ResetCounts(nullptr, nullptr);
}

CHIP_ERROR chip_ime_ReadAttribute_ThreadNetworkDiagnostics_Channel(chip::Controller::Device * device,
                                                                   chip::EndpointId ZCLendpointId, chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ThreadNetworkDiagnosticsCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeChannel(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_ThreadNetworkDiagnostics_RoutingRole(chip::Controller::Device * device,
                                                                       chip::EndpointId ZCLendpointId,
                                                                       chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ThreadNetworkDiagnosticsCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeRoutingRole(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_ThreadNetworkDiagnostics_NetworkName(chip::Controller::Device * device,
                                                                       chip::EndpointId ZCLendpointId,
                                                                       chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ThreadNetworkDiagnosticsCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeNetworkName(gStringAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_ThreadNetworkDiagnostics_PanId(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                                 chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ThreadNetworkDiagnosticsCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributePanId(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_ThreadNetworkDiagnostics_ExtendedPanId(chip::Controller::Device * device,
                                                                         chip::EndpointId ZCLendpointId,
                                                                         chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ThreadNetworkDiagnosticsCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeExtendedPanId(gInt64uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_ThreadNetworkDiagnostics_MeshLocalPrefix(chip::Controller::Device * device,
                                                                           chip::EndpointId ZCLendpointId,
                                                                           chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ThreadNetworkDiagnosticsCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeMeshLocalPrefix(gStringAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_ThreadNetworkDiagnostics_OverrunCount(chip::Controller::Device * device,
                                                                        chip::EndpointId ZCLendpointId,
                                                                        chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ThreadNetworkDiagnosticsCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeOverrunCount(gInt64uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_ThreadNetworkDiagnostics_NeighborTableList(chip::Controller::Device * device,
                                                                             chip::EndpointId ZCLendpointId,
                                                                             chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ThreadNetworkDiagnosticsCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeNeighborTableList(gThreadNetworkDiagnosticsNeighborTableListListAttributeCallback.Cancel(),
                                                  gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_ThreadNetworkDiagnostics_RouteTableList(chip::Controller::Device * device,
                                                                          chip::EndpointId ZCLendpointId,
                                                                          chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ThreadNetworkDiagnosticsCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeRouteTableList(gThreadNetworkDiagnosticsRouteTableListListAttributeCallback.Cancel(),
                                               gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_ThreadNetworkDiagnostics_PartitionId(chip::Controller::Device * device,
                                                                       chip::EndpointId ZCLendpointId,
                                                                       chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ThreadNetworkDiagnosticsCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributePartitionId(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_ThreadNetworkDiagnostics_Weighting(chip::Controller::Device * device,
                                                                     chip::EndpointId ZCLendpointId, chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ThreadNetworkDiagnosticsCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeWeighting(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_ThreadNetworkDiagnostics_DataVersion(chip::Controller::Device * device,
                                                                       chip::EndpointId ZCLendpointId,
                                                                       chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ThreadNetworkDiagnosticsCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeDataVersion(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_ThreadNetworkDiagnostics_StableDataVersion(chip::Controller::Device * device,
                                                                             chip::EndpointId ZCLendpointId,
                                                                             chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ThreadNetworkDiagnosticsCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeStableDataVersion(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_ThreadNetworkDiagnostics_LeaderRouterId(chip::Controller::Device * device,
                                                                          chip::EndpointId ZCLendpointId,
                                                                          chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ThreadNetworkDiagnosticsCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeLeaderRouterId(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_ThreadNetworkDiagnostics_DetachedRoleCount(chip::Controller::Device * device,
                                                                             chip::EndpointId ZCLendpointId,
                                                                             chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ThreadNetworkDiagnosticsCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeDetachedRoleCount(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_ThreadNetworkDiagnostics_ChildRoleCount(chip::Controller::Device * device,
                                                                          chip::EndpointId ZCLendpointId,
                                                                          chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ThreadNetworkDiagnosticsCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeChildRoleCount(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_ThreadNetworkDiagnostics_RouterRoleCount(chip::Controller::Device * device,
                                                                           chip::EndpointId ZCLendpointId,
                                                                           chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ThreadNetworkDiagnosticsCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeRouterRoleCount(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_ThreadNetworkDiagnostics_LeaderRoleCount(chip::Controller::Device * device,
                                                                           chip::EndpointId ZCLendpointId,
                                                                           chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ThreadNetworkDiagnosticsCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeLeaderRoleCount(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_ThreadNetworkDiagnostics_AttachAttemptCount(chip::Controller::Device * device,
                                                                              chip::EndpointId ZCLendpointId,
                                                                              chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ThreadNetworkDiagnosticsCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeAttachAttemptCount(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_ThreadNetworkDiagnostics_PartitionIdChangeCount(chip::Controller::Device * device,
                                                                                  chip::EndpointId ZCLendpointId,
                                                                                  chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ThreadNetworkDiagnosticsCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributePartitionIdChangeCount(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_ThreadNetworkDiagnostics_BetterPartitionAttachAttemptCount(chip::Controller::Device * device,
                                                                                             chip::EndpointId ZCLendpointId,
                                                                                             chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ThreadNetworkDiagnosticsCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeBetterPartitionAttachAttemptCount(gInt16uAttributeCallback.Cancel(),
                                                                  gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_ThreadNetworkDiagnostics_ParentChangeCount(chip::Controller::Device * device,
                                                                             chip::EndpointId ZCLendpointId,
                                                                             chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ThreadNetworkDiagnosticsCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeParentChangeCount(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_ThreadNetworkDiagnostics_TxTotalCount(chip::Controller::Device * device,
                                                                        chip::EndpointId ZCLendpointId,
                                                                        chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ThreadNetworkDiagnosticsCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeTxTotalCount(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_ThreadNetworkDiagnostics_TxUnicastCount(chip::Controller::Device * device,
                                                                          chip::EndpointId ZCLendpointId,
                                                                          chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ThreadNetworkDiagnosticsCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeTxUnicastCount(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_ThreadNetworkDiagnostics_TxBroadcastCount(chip::Controller::Device * device,
                                                                            chip::EndpointId ZCLendpointId,
                                                                            chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ThreadNetworkDiagnosticsCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeTxBroadcastCount(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_ThreadNetworkDiagnostics_TxAckRequestedCount(chip::Controller::Device * device,
                                                                               chip::EndpointId ZCLendpointId,
                                                                               chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ThreadNetworkDiagnosticsCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeTxAckRequestedCount(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_ThreadNetworkDiagnostics_TxAckedCount(chip::Controller::Device * device,
                                                                        chip::EndpointId ZCLendpointId,
                                                                        chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ThreadNetworkDiagnosticsCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeTxAckedCount(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_ThreadNetworkDiagnostics_TxNoAckRequestedCount(chip::Controller::Device * device,
                                                                                 chip::EndpointId ZCLendpointId,
                                                                                 chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ThreadNetworkDiagnosticsCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeTxNoAckRequestedCount(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_ThreadNetworkDiagnostics_TxDataCount(chip::Controller::Device * device,
                                                                       chip::EndpointId ZCLendpointId,
                                                                       chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ThreadNetworkDiagnosticsCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeTxDataCount(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_ThreadNetworkDiagnostics_TxDataPollCount(chip::Controller::Device * device,
                                                                           chip::EndpointId ZCLendpointId,
                                                                           chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ThreadNetworkDiagnosticsCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeTxDataPollCount(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_ThreadNetworkDiagnostics_TxBeaconCount(chip::Controller::Device * device,
                                                                         chip::EndpointId ZCLendpointId,
                                                                         chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ThreadNetworkDiagnosticsCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeTxBeaconCount(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_ThreadNetworkDiagnostics_TxBeaconRequestCount(chip::Controller::Device * device,
                                                                                chip::EndpointId ZCLendpointId,
                                                                                chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ThreadNetworkDiagnosticsCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeTxBeaconRequestCount(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_ThreadNetworkDiagnostics_TxOtherCount(chip::Controller::Device * device,
                                                                        chip::EndpointId ZCLendpointId,
                                                                        chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ThreadNetworkDiagnosticsCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeTxOtherCount(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_ThreadNetworkDiagnostics_TxRetryCount(chip::Controller::Device * device,
                                                                        chip::EndpointId ZCLendpointId,
                                                                        chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ThreadNetworkDiagnosticsCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeTxRetryCount(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_ThreadNetworkDiagnostics_TxDirectMaxRetryExpiryCount(chip::Controller::Device * device,
                                                                                       chip::EndpointId ZCLendpointId,
                                                                                       chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ThreadNetworkDiagnosticsCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeTxDirectMaxRetryExpiryCount(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_ThreadNetworkDiagnostics_TxIndirectMaxRetryExpiryCount(chip::Controller::Device * device,
                                                                                         chip::EndpointId ZCLendpointId,
                                                                                         chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ThreadNetworkDiagnosticsCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeTxIndirectMaxRetryExpiryCount(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_ThreadNetworkDiagnostics_TxErrCcaCount(chip::Controller::Device * device,
                                                                         chip::EndpointId ZCLendpointId,
                                                                         chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ThreadNetworkDiagnosticsCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeTxErrCcaCount(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_ThreadNetworkDiagnostics_TxErrAbortCount(chip::Controller::Device * device,
                                                                           chip::EndpointId ZCLendpointId,
                                                                           chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ThreadNetworkDiagnosticsCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeTxErrAbortCount(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_ThreadNetworkDiagnostics_TxErrBusyChannelCount(chip::Controller::Device * device,
                                                                                 chip::EndpointId ZCLendpointId,
                                                                                 chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ThreadNetworkDiagnosticsCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeTxErrBusyChannelCount(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_ThreadNetworkDiagnostics_RxTotalCount(chip::Controller::Device * device,
                                                                        chip::EndpointId ZCLendpointId,
                                                                        chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ThreadNetworkDiagnosticsCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeRxTotalCount(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_ThreadNetworkDiagnostics_RxUnicastCount(chip::Controller::Device * device,
                                                                          chip::EndpointId ZCLendpointId,
                                                                          chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ThreadNetworkDiagnosticsCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeRxUnicastCount(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_ThreadNetworkDiagnostics_RxBroadcastCount(chip::Controller::Device * device,
                                                                            chip::EndpointId ZCLendpointId,
                                                                            chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ThreadNetworkDiagnosticsCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeRxBroadcastCount(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_ThreadNetworkDiagnostics_RxDataCount(chip::Controller::Device * device,
                                                                       chip::EndpointId ZCLendpointId,
                                                                       chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ThreadNetworkDiagnosticsCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeRxDataCount(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_ThreadNetworkDiagnostics_RxDataPollCount(chip::Controller::Device * device,
                                                                           chip::EndpointId ZCLendpointId,
                                                                           chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ThreadNetworkDiagnosticsCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeRxDataPollCount(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_ThreadNetworkDiagnostics_RxBeaconCount(chip::Controller::Device * device,
                                                                         chip::EndpointId ZCLendpointId,
                                                                         chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ThreadNetworkDiagnosticsCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeRxBeaconCount(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_ThreadNetworkDiagnostics_RxBeaconRequestCount(chip::Controller::Device * device,
                                                                                chip::EndpointId ZCLendpointId,
                                                                                chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ThreadNetworkDiagnosticsCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeRxBeaconRequestCount(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_ThreadNetworkDiagnostics_RxOtherCount(chip::Controller::Device * device,
                                                                        chip::EndpointId ZCLendpointId,
                                                                        chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ThreadNetworkDiagnosticsCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeRxOtherCount(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_ThreadNetworkDiagnostics_RxAddressFilteredCount(chip::Controller::Device * device,
                                                                                  chip::EndpointId ZCLendpointId,
                                                                                  chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ThreadNetworkDiagnosticsCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeRxAddressFilteredCount(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_ThreadNetworkDiagnostics_RxDestAddrFilteredCount(chip::Controller::Device * device,
                                                                                   chip::EndpointId ZCLendpointId,
                                                                                   chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ThreadNetworkDiagnosticsCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeRxDestAddrFilteredCount(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_ThreadNetworkDiagnostics_RxDuplicatedCount(chip::Controller::Device * device,
                                                                             chip::EndpointId ZCLendpointId,
                                                                             chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ThreadNetworkDiagnosticsCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeRxDuplicatedCount(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_ThreadNetworkDiagnostics_RxErrNoFrameCount(chip::Controller::Device * device,
                                                                             chip::EndpointId ZCLendpointId,
                                                                             chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ThreadNetworkDiagnosticsCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeRxErrNoFrameCount(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_ThreadNetworkDiagnostics_RxErrUnknownNeighborCount(chip::Controller::Device * device,
                                                                                     chip::EndpointId ZCLendpointId,
                                                                                     chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ThreadNetworkDiagnosticsCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeRxErrUnknownNeighborCount(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_ThreadNetworkDiagnostics_RxErrInvalidSrcAddrCount(chip::Controller::Device * device,
                                                                                    chip::EndpointId ZCLendpointId,
                                                                                    chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ThreadNetworkDiagnosticsCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeRxErrInvalidSrcAddrCount(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_ThreadNetworkDiagnostics_RxErrSecCount(chip::Controller::Device * device,
                                                                         chip::EndpointId ZCLendpointId,
                                                                         chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ThreadNetworkDiagnosticsCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeRxErrSecCount(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_ThreadNetworkDiagnostics_RxErrFcsCount(chip::Controller::Device * device,
                                                                         chip::EndpointId ZCLendpointId,
                                                                         chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ThreadNetworkDiagnosticsCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeRxErrFcsCount(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_ThreadNetworkDiagnostics_RxErrOtherCount(chip::Controller::Device * device,
                                                                           chip::EndpointId ZCLendpointId,
                                                                           chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ThreadNetworkDiagnosticsCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeRxErrOtherCount(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_ThreadNetworkDiagnostics_SecurityPolicy(chip::Controller::Device * device,
                                                                          chip::EndpointId ZCLendpointId,
                                                                          chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ThreadNetworkDiagnosticsCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeSecurityPolicy(gThreadNetworkDiagnosticsSecurityPolicyListAttributeCallback.Cancel(),
                                               gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_ThreadNetworkDiagnostics_ChannelMask(chip::Controller::Device * device,
                                                                       chip::EndpointId ZCLendpointId,
                                                                       chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ThreadNetworkDiagnosticsCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeChannelMask(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_ThreadNetworkDiagnostics_OperationalDatasetComponents(chip::Controller::Device * device,
                                                                                        chip::EndpointId ZCLendpointId,
                                                                                        chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ThreadNetworkDiagnosticsCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeOperationalDatasetComponents(
        gThreadNetworkDiagnosticsOperationalDatasetComponentsListAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_ThreadNetworkDiagnostics_ActiveNetworkFaultsList(chip::Controller::Device * device,
                                                                                   chip::EndpointId ZCLendpointId,
                                                                                   chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ThreadNetworkDiagnosticsCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeActiveNetworkFaultsList(
        gThreadNetworkDiagnosticsActiveNetworkFaultsListListAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_ThreadNetworkDiagnostics_ClusterRevision(chip::Controller::Device * device,
                                                                           chip::EndpointId ZCLendpointId,
                                                                           chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::ThreadNetworkDiagnosticsCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

// End of Cluster ThreadNetworkDiagnostics
// Cluster WakeOnLan

CHIP_ERROR chip_ime_ReadAttribute_WakeOnLan_WakeOnLanMacAddress(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                                chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::WakeOnLanCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeWakeOnLanMacAddress(gStringAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_WakeOnLan_ClusterRevision(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                            chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::WakeOnLanCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

// End of Cluster WakeOnLan
// Cluster WiFiNetworkDiagnostics

CHIP_ERROR chip_ime_ReadAttribute_WiFiNetworkDiagnostics_Bssid(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                               chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::WiFiNetworkDiagnosticsCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeBssid(gStringAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_WiFiNetworkDiagnostics_SecurityType(chip::Controller::Device * device,
                                                                      chip::EndpointId ZCLendpointId,
                                                                      chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::WiFiNetworkDiagnosticsCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeSecurityType(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_WiFiNetworkDiagnostics_WiFiVersion(chip::Controller::Device * device,
                                                                     chip::EndpointId ZCLendpointId, chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::WiFiNetworkDiagnosticsCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeWiFiVersion(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_WiFiNetworkDiagnostics_ChannelNumber(chip::Controller::Device * device,
                                                                       chip::EndpointId ZCLendpointId,
                                                                       chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::WiFiNetworkDiagnosticsCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeChannelNumber(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_WiFiNetworkDiagnostics_Rssi(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                              chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::WiFiNetworkDiagnosticsCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeRssi(gInt8sAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_WiFiNetworkDiagnostics_ClusterRevision(chip::Controller::Device * device,
                                                                         chip::EndpointId ZCLendpointId,
                                                                         chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::WiFiNetworkDiagnosticsCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

// End of Cluster WiFiNetworkDiagnostics
// Cluster WindowCovering

CHIP_ERROR chip_ime_AppendCommand_WindowCovering_DownOrClose(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                             chip::GroupId)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::WindowCoveringCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.DownOrClose(nullptr, nullptr);
}
CHIP_ERROR chip_ime_AppendCommand_WindowCovering_GoToLiftPercentage(chip::Controller::Device * device,
                                                                    chip::EndpointId ZCLendpointId, chip::GroupId,
                                                                    uint8_t liftPercentageValue, uint16_t liftPercent100thsValue)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::WindowCoveringCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.GoToLiftPercentage(nullptr, nullptr, liftPercentageValue, liftPercent100thsValue);
}
CHIP_ERROR chip_ime_AppendCommand_WindowCovering_GoToLiftValue(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                               chip::GroupId, uint16_t liftValue)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::WindowCoveringCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.GoToLiftValue(nullptr, nullptr, liftValue);
}
CHIP_ERROR chip_ime_AppendCommand_WindowCovering_GoToTiltPercentage(chip::Controller::Device * device,
                                                                    chip::EndpointId ZCLendpointId, chip::GroupId,
                                                                    uint8_t tiltPercentageValue, uint16_t tiltPercent100thsValue)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::WindowCoveringCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.GoToTiltPercentage(nullptr, nullptr, tiltPercentageValue, tiltPercent100thsValue);
}
CHIP_ERROR chip_ime_AppendCommand_WindowCovering_GoToTiltValue(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                               chip::GroupId, uint16_t tiltValue)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::WindowCoveringCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.GoToTiltValue(nullptr, nullptr, tiltValue);
}
CHIP_ERROR chip_ime_AppendCommand_WindowCovering_StopMotion(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                            chip::GroupId)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::WindowCoveringCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.StopMotion(nullptr, nullptr);
}
CHIP_ERROR chip_ime_AppendCommand_WindowCovering_UpOrOpen(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                          chip::GroupId)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::WindowCoveringCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.UpOrOpen(nullptr, nullptr);
}

CHIP_ERROR chip_ime_ReadAttribute_WindowCovering_Type(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                      chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::WindowCoveringCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeType(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_WindowCovering_CurrentPositionLift(chip::Controller::Device * device,
                                                                     chip::EndpointId ZCLendpointId, chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::WindowCoveringCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeCurrentPositionLift(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_WindowCovering_CurrentPositionTilt(chip::Controller::Device * device,
                                                                     chip::EndpointId ZCLendpointId, chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::WindowCoveringCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeCurrentPositionTilt(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_WindowCovering_ConfigStatus(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                              chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::WindowCoveringCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeConfigStatus(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_WindowCovering_CurrentPositionLiftPercentage(chip::Controller::Device * device,
                                                                               chip::EndpointId ZCLendpointId,
                                                                               chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::WindowCoveringCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeCurrentPositionLiftPercentage(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ConfigureAttribute_WindowCovering_CurrentPositionLiftPercentage(chip::Controller::Device * device,
                                                                                    chip::EndpointId ZCLendpointId,
                                                                                    uint16_t minInterval, uint16_t maxInterval,
                                                                                    uint8_t change)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::WindowCoveringCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ConfigureAttributeCurrentPositionLiftPercentage(
        gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, maxInterval, change);
}

CHIP_ERROR chip_ime_ReadAttribute_WindowCovering_CurrentPositionTiltPercentage(chip::Controller::Device * device,
                                                                               chip::EndpointId ZCLendpointId,
                                                                               chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::WindowCoveringCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeCurrentPositionTiltPercentage(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ConfigureAttribute_WindowCovering_CurrentPositionTiltPercentage(chip::Controller::Device * device,
                                                                                    chip::EndpointId ZCLendpointId,
                                                                                    uint16_t minInterval, uint16_t maxInterval,
                                                                                    uint8_t change)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::WindowCoveringCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ConfigureAttributeCurrentPositionTiltPercentage(
        gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, maxInterval, change);
}

CHIP_ERROR chip_ime_ReadAttribute_WindowCovering_OperationalStatus(chip::Controller::Device * device,
                                                                   chip::EndpointId ZCLendpointId, chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::WindowCoveringCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeOperationalStatus(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ConfigureAttribute_WindowCovering_OperationalStatus(chip::Controller::Device * device,
                                                                        chip::EndpointId ZCLendpointId, uint16_t minInterval,
                                                                        uint16_t maxInterval)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::WindowCoveringCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ConfigureAttributeOperationalStatus(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(),
                                                       minInterval, maxInterval);
}

CHIP_ERROR chip_ime_ReadAttribute_WindowCovering_TargetPositionLiftPercent100ths(chip::Controller::Device * device,
                                                                                 chip::EndpointId ZCLendpointId,
                                                                                 chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::WindowCoveringCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeTargetPositionLiftPercent100ths(gInt16uAttributeCallback.Cancel(),
                                                                gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ConfigureAttribute_WindowCovering_TargetPositionLiftPercent100ths(chip::Controller::Device * device,
                                                                                      chip::EndpointId ZCLendpointId,
                                                                                      uint16_t minInterval, uint16_t maxInterval,
                                                                                      uint16_t change)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::WindowCoveringCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ConfigureAttributeTargetPositionLiftPercent100ths(
        gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, maxInterval, change);
}

CHIP_ERROR chip_ime_ReadAttribute_WindowCovering_TargetPositionTiltPercent100ths(chip::Controller::Device * device,
                                                                                 chip::EndpointId ZCLendpointId,
                                                                                 chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::WindowCoveringCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeTargetPositionTiltPercent100ths(gInt16uAttributeCallback.Cancel(),
                                                                gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ConfigureAttribute_WindowCovering_TargetPositionTiltPercent100ths(chip::Controller::Device * device,
                                                                                      chip::EndpointId ZCLendpointId,
                                                                                      uint16_t minInterval, uint16_t maxInterval,
                                                                                      uint16_t change)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::WindowCoveringCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ConfigureAttributeTargetPositionTiltPercent100ths(
        gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, maxInterval, change);
}

CHIP_ERROR chip_ime_ReadAttribute_WindowCovering_EndProductType(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                                chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::WindowCoveringCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeEndProductType(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_WindowCovering_CurrentPositionLiftPercent100ths(chip::Controller::Device * device,
                                                                                  chip::EndpointId ZCLendpointId,
                                                                                  chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::WindowCoveringCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeCurrentPositionLiftPercent100ths(gInt16uAttributeCallback.Cancel(),
                                                                 gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ConfigureAttribute_WindowCovering_CurrentPositionLiftPercent100ths(chip::Controller::Device * device,
                                                                                       chip::EndpointId ZCLendpointId,
                                                                                       uint16_t minInterval, uint16_t maxInterval,
                                                                                       uint16_t change)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::WindowCoveringCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ConfigureAttributeCurrentPositionLiftPercent100ths(
        gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, maxInterval, change);
}

CHIP_ERROR chip_ime_ReadAttribute_WindowCovering_CurrentPositionTiltPercent100ths(chip::Controller::Device * device,
                                                                                  chip::EndpointId ZCLendpointId,
                                                                                  chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::WindowCoveringCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeCurrentPositionTiltPercent100ths(gInt16uAttributeCallback.Cancel(),
                                                                 gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ConfigureAttribute_WindowCovering_CurrentPositionTiltPercent100ths(chip::Controller::Device * device,
                                                                                       chip::EndpointId ZCLendpointId,
                                                                                       uint16_t minInterval, uint16_t maxInterval,
                                                                                       uint16_t change)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::WindowCoveringCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ConfigureAttributeCurrentPositionTiltPercent100ths(
        gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, maxInterval, change);
}

CHIP_ERROR chip_ime_ReadAttribute_WindowCovering_InstalledOpenLimitLift(chip::Controller::Device * device,
                                                                        chip::EndpointId ZCLendpointId,
                                                                        chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::WindowCoveringCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeInstalledOpenLimitLift(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_WindowCovering_InstalledClosedLimitLift(chip::Controller::Device * device,
                                                                          chip::EndpointId ZCLendpointId,
                                                                          chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::WindowCoveringCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeInstalledClosedLimitLift(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_WindowCovering_InstalledOpenLimitTilt(chip::Controller::Device * device,
                                                                        chip::EndpointId ZCLendpointId,
                                                                        chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::WindowCoveringCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeInstalledOpenLimitTilt(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_WindowCovering_InstalledClosedLimitTilt(chip::Controller::Device * device,
                                                                          chip::EndpointId ZCLendpointId,
                                                                          chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::WindowCoveringCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeInstalledClosedLimitTilt(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ReadAttribute_WindowCovering_Mode(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                      chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::WindowCoveringCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeMode(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_WriteAttribute_WindowCovering_Mode(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                       chip::GroupId, uint8_t value)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::WindowCoveringCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.WriteAttributeMode(gDefaultSuccessCallback.Cancel(), gDefaultFailureCallback.Cancel(), value);
}
CHIP_ERROR chip_ime_ReadAttribute_WindowCovering_SafetyStatus(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                              chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::WindowCoveringCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeSafetyStatus(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

CHIP_ERROR chip_ime_ConfigureAttribute_WindowCovering_SafetyStatus(chip::Controller::Device * device,
                                                                   chip::EndpointId ZCLendpointId, uint16_t minInterval,
                                                                   uint16_t maxInterval)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::WindowCoveringCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ConfigureAttributeSafetyStatus(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval,
                                                  maxInterval);
}

CHIP_ERROR chip_ime_ReadAttribute_WindowCovering_ClusterRevision(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
                                                                 chip::GroupId /* ZCLgroupId */)
{
    VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
    chip::Controller::WindowCoveringCluster cluster;
    cluster.Associate(device, ZCLendpointId);
    return cluster.ReadAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
}

// End of Cluster WindowCovering
}
